From edd01db802ee5a2de24b93e1d80dfdf2cf20df14 Mon Sep 17 00:00:00 2001 From: solarthesis <156844032+solarthesis@users.noreply.github.com> Date: Tue, 13 Feb 2024 19:27:33 +0100 Subject: [PATCH 1/2] Update Comments As per request https://github.com/ApeWorX/ape-safe/pull/32#discussion_r1486796624 --- ape_safe/multisend.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ape_safe/multisend.py b/ape_safe/multisend.py index 99fb702..e2208e5 100644 --- a/ape_safe/multisend.py +++ b/ape_safe/multisend.py @@ -91,6 +91,7 @@ class MultiSend(ManagerAccessMixin): from ape_safe import multisend from ape import accounts + from ape.exceptions import SignatureError # load the safe safe = accounts.load("my-safe") @@ -101,9 +102,15 @@ class MultiSend(ManagerAccessMixin): ... # Add as many calls as desired to execute txn.add(contract.myMethod, *call_args) - # Stage the transaction to publish on-chain - # NOTE: if not enough signers are available, publish to Safe API instead - receipt = txn(sender=safe,gas=0) + # Fetch signatures from any local signers, and broadcast if confirmations are met + # Note that in case the user intends to only stage a transaction, then `submit=False` argument can also be added + # It is normal that when a user only intends to stage a transaction, an error is thrown + # this can be ignored by including the necessary try-catch (from ape.exceptions import SignatureError) + # Note that transaction is automatically prompted for execution if enough signers are available in local + try: + receipt = txn(sender=safe,gas=0) + except SignatureError: + pass """ def __init__(self) -> None: From 4a35195b2c86240b31d8e6728f36ab22c2a21b59 Mon Sep 17 00:00:00 2001 From: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:03:26 -0500 Subject: [PATCH 2/2] refactor: docstring --- ape_safe/multisend.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ape_safe/multisend.py b/ape_safe/multisend.py index e2208e5..7319339 100644 --- a/ape_safe/multisend.py +++ b/ape_safe/multisend.py @@ -102,11 +102,12 @@ class MultiSend(ManagerAccessMixin): ... # Add as many calls as desired to execute txn.add(contract.myMethod, *call_args) - # Fetch signatures from any local signers, and broadcast if confirmations are met - # Note that in case the user intends to only stage a transaction, then `submit=False` argument can also be added - # It is normal that when a user only intends to stage a transaction, an error is thrown - # this can be ignored by including the necessary try-catch (from ape.exceptions import SignatureError) - # Note that transaction is automatically prompted for execution if enough signers are available in local + # Fetch signatures from any local signers, and broadcast if confirmations are met. + # NOTE: in case the user intends to only stage a transaction then `submit_transaction=False` + # argument can also be added. It is normal that when you only intend to stage a + # transaction that an error is thrown, and this behavior can be skipped by using try- + # catch when trying to submit the transaction (`ape.exceptions.SignatureError`). + # NOTE: SafeTx is automatically prompted for execution if there are enough local signers. try: receipt = txn(sender=safe,gas=0) except SignatureError: