Skip to content

Commit

Permalink
Fix typing and defaults on SafeTx
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Feb 7, 2022
1 parent 5eaaa5d commit 3978e92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions gnosis/safe/multi_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def __init__(self, address: str, ethereum_client: EthereumClient):
def from_bytes(cls, encoded_multisend_txs: Union[str, bytes]) -> List[MultiSendTx]:
"""
Decodes one or more multisend transactions from `bytes transactions` (Abi decoded)
:param encoded_multisend_txs:
:return: List of MultiSendTxs
"""
Expand Down Expand Up @@ -206,6 +207,7 @@ def from_transaction_data(
) -> List[MultiSendTx]:
"""
Decodes multisend transactions from transaction data (ABI encoded with selector)
:return:
"""
try:
Expand All @@ -222,6 +224,7 @@ def deploy_contract(
) -> EthereumTxSent:
"""
Deploy proxy factory contract
:param ethereum_client:
:param deployer_account: Ethereum Account
:return: deployed contract address
Expand Down Expand Up @@ -249,6 +252,7 @@ def get_contract(self):
def build_tx_data(self, multi_send_txs: List[MultiSendTx]) -> bytes:
"""
Txs don't need to be valid to get through
:param multi_send_txs:
:param sender:
:return:
Expand Down
11 changes: 5 additions & 6 deletions gnosis/safe/safe_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ def __init__(
self,
ethereum_client: EthereumClient,
safe_address: str,
to: str,
to: Optional[str],
value: int,
data: bytes,
operation: int,
safe_tx_gas: int,
base_gas: int,
gas_price: int,
gas_token: str,
refund_receiver: str,
signatures: bytes = b"",
gas_token: Optional[str],
refund_receiver: Optional[str],
signatures: Optional[bytes] = None,
safe_nonce: Optional[int] = None,
safe_version: str = None,
chain_id: Optional[int] = None,
Expand All @@ -115,7 +115,6 @@ def __init__(
it will be retrieved from the provided ethereum_client
"""

assert isinstance(signatures, bytes), "Signatures must be bytes"
self.ethereum_client = ethereum_client
self.safe_address = safe_address
self.to = to or NULL_ADDRESS
Expand All @@ -127,7 +126,7 @@ def __init__(
self.gas_price = gas_price
self.gas_token = gas_token or NULL_ADDRESS
self.refund_receiver = refund_receiver or NULL_ADDRESS
self.signatures = signatures
self.signatures = signatures or b""
self._safe_nonce = safe_nonce
self._safe_version = safe_version
self._chain_id = chain_id
Expand Down

0 comments on commit 3978e92

Please sign in to comment.