Skip to content

Commit

Permalink
fix(API): client accepts empty signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Jun 5, 2024
1 parent 8d7d129 commit 20391e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ape_safe/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def post_transaction(
b"",
)
)
post_dict: Dict = {"signature": signature.hex()}
post_dict: Dict = {"signature": signature.hex() if signature else None}

for key, value in tx_data.model_dump(by_alias=True, mode="json").items():
if isinstance(value, HexBytes):
Expand Down Expand Up @@ -201,6 +201,7 @@ def get_delegates(self) -> Dict[AddressType, List[AddressType]]:

def add_delegate(self, delegate: AddressType, label: str, delegator: AccountAPI):
# TODO: Replace this by adding raw hash signing into supported account plugins
# See: https://github.com/ApeWorX/ape/issues/1962
if not isinstance(delegator, KeyfileAccount):
raise ActionNotPerformedError("Need access to private key for this method.")

Expand All @@ -225,6 +226,7 @@ def add_delegate(self, delegate: AddressType, label: str, delegator: AccountAPI)

def remove_delegate(self, delegate: AddressType, delegator: AccountAPI):
# TODO: Replace this by adding raw hash signing into supported account plugins
# See: https://github.com/ApeWorX/ape/issues/1962
if not isinstance(delegator, KeyfileAccount):
raise ActionNotPerformedError("Need access to private key for this method.")

Expand Down

0 comments on commit 20391e3

Please sign in to comment.