-
Notifications
You must be signed in to change notification settings - Fork 37
Fix transaction re-signing #554
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| import logging | ||
| import sys | ||
| from argparse import FileType | ||
| from copy import deepcopy | ||
| from functools import cache | ||
| from getpass import getpass | ||
| from pathlib import Path | ||
|
|
@@ -862,6 +863,8 @@ def alter_transaction_and_sign_again_if_needed( | |
| sender: IAccount, | ||
| guardian_and_relayer_data: GuardianRelayerData, | ||
| ): | ||
| initial_tx = deepcopy(tx) | ||
|
|
||
| set_options_for_hash_signing_if_needed( | ||
| transaction=tx, | ||
| guardian=guardian_and_relayer_data.guardian, | ||
|
|
@@ -870,6 +873,7 @@ def alter_transaction_and_sign_again_if_needed( | |
|
|
||
| altered = _alter_version_and_options_if_provided( | ||
| args=args, | ||
| initial_tx=initial_tx, | ||
| transaction=tx, | ||
| ) | ||
|
|
||
|
|
@@ -883,13 +887,20 @@ def alter_transaction_and_sign_again_if_needed( | |
|
|
||
| def _alter_version_and_options_if_provided( | ||
| args: Any, | ||
| initial_tx: Transaction, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming inconsistency. |
||
| transaction: Transaction, | ||
| ) -> bool: | ||
| """Alters the transaction version and options if they are provided in args. | ||
| Returns True if any alteration was made, False otherwise. | ||
| """ | ||
| altered = False | ||
|
|
||
| if initial_tx.version != transaction.version: | ||
| altered = True | ||
|
|
||
| if initial_tx.options != transaction.options: | ||
| altered = True | ||
|
Comment on lines
+898
to
+902
|
||
|
|
||
| if args.version != DEFAULT_TX_VERSION and transaction.version != args.version: | ||
| transaction.version = args.version | ||
| altered = True | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming inconsistency,
txvs.transaction.