Skip to content

Commit

Permalink
OCT-2177: Fixing multisig on patron mode toggle (#547)
Browse files Browse the repository at this point in the history
## Description
Switched to using newer signature verifier, removed unused code

## Definition of Done

1. [ ] If required, the desciption of your change is added to the [QA
changelog](https://www.notion.so/octantapp/Changelog-for-the-QA-d96fa3b411cf488bb1d8d9a598d88281)
2. [ ] Acceptance criteria are met.
3. [ ] PR is manually tested before the merge by developer(s).
    - [ ] Happy path is manually checked.
4. [ ] PR is manually tested by QA when their assistance is required
(1).
- [ ] Octant Areas & Test Cases are checked for impact and updated if
required (2).
5. [ ] Unit tests are added unless there is a reason to omit them.
6. [ ] Automated tests are added when required.
7. [ ] The code is merged.
8. [ ] Tech documentation is added / updated, reviewed and approved
(including mandatory approval by a code owner, should such exist for
changed files).
    - [ ] BE: Swagger documentation is updated.
9. [ ] When required by QA:
    - [ ] Deployed to the relevant environment.
    - [ ] Passed system tests.

---

(1) Developer(s) in coordination with QA decide whether it's required.
For small tickets introducing small changes QA assistance is most
probably not required.

(2) [Octant Areas & Test
Cases](https://docs.google.com/spreadsheets/d/1cRe6dxuKJV3a4ZskAwWEPvrFkQm6rEfyUCYwLTYw_Cc).
  • Loading branch information
adam-gf authored Nov 19, 2024
1 parent 80f7750 commit 6105fea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 41 deletions.
10 changes: 8 additions & 2 deletions backend/app/legacy/crypto/eth_sign/patron_mode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from app.legacy.crypto.eth_sign.signature import verify_signed_message
from app.modules.common.crypto.signature import (
encode_for_signing,
EncodingStandardFor,
verify_signed_message,
)


def build_patron_mode_msg(user_address: str, toggle: bool) -> str:
Expand All @@ -9,4 +13,6 @@ def build_patron_mode_msg(user_address: str, toggle: bool) -> str:
def verify(user_address: str, toggle: bool, signature: str) -> bool:
msg_text = build_patron_mode_msg(user_address, toggle)

return verify_signed_message(user_address, msg_text, signature)
encoded_msg = encode_for_signing(EncodingStandardFor.TEXT, msg_text)

return verify_signed_message(user_address, encoded_msg, signature)
36 changes: 0 additions & 36 deletions backend/app/legacy/crypto/eth_sign/signature.py

This file was deleted.

3 changes: 0 additions & 3 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,9 +1030,6 @@ def patch_vault(monkeypatch):

@pytest.fixture(scope="function")
def patch_is_contract(monkeypatch):
monkeypatch.setattr(
"app.legacy.crypto.eth_sign.signature.is_contract", MOCK_IS_CONTRACT
)
monkeypatch.setattr(
"app.modules.common.crypto.signature.is_contract", MOCK_IS_CONTRACT
)
Expand Down

0 comments on commit 6105fea

Please sign in to comment.