Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing and defaults on SafeTx #188

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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