Skip to content

Commit c4ef72a

Browse files
committed
fix(Client): SafeTx V1 does not support baseGas
1 parent 3c62db5 commit c4ef72a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ape_safe/client/types.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ def as_safe_tx(self, version: str, chain_id: Optional[int] = None) -> SafeTx:
125125
chain_id=chain_id,
126126
)
127127

128+
# NOTE: Safe pre-v1.3.0 did not have `baseGas` parameter
129+
if not hasattr(tx_def, "baseGas"):
130+
return tx_def( # type: ignore[call-arg]
131+
to=self.to,
132+
value=self.value,
133+
data=self.data,
134+
operation=self.operation,
135+
gasToken=self.gas_token,
136+
safeTxGas=self.safe_tx_gas,
137+
gasPrice=self.gas_price,
138+
refundReceiver=self.refund_receiver,
139+
nonce=self.nonce,
140+
)
141+
128142
return tx_def( # type: ignore[call-arg]
129143
to=self.to,
130144
value=self.value,

0 commit comments

Comments
 (0)