kopia lustrzana https://github.com/bugout-dev/moonworm
Merge pull request #36 from zomglings/transaction-config-nonce
Added --nonce argument to generate-brownie CLIpull/38/head v0.1.9
commit
1730c4a077
|
@ -166,6 +166,7 @@ PROTECTED_ARG_NAMES: Set[str] = {
|
|||
"gas-price",
|
||||
"gas-limit",
|
||||
"network",
|
||||
"nonce",
|
||||
"password",
|
||||
"sender",
|
||||
"signer",
|
||||
|
|
|
@ -243,6 +243,20 @@ def generate_get_transaction_config() -> cst.FunctionDef:
|
|||
'transaction_config["required_confs"] = args.confirmations'
|
||||
),
|
||||
),
|
||||
cst.If(
|
||||
test=cst.Comparison(
|
||||
left=cst.Attribute(
|
||||
attr=cst.Name(value="nonce"),
|
||||
value=cst.Name(value="args"),
|
||||
),
|
||||
comparisons=[
|
||||
cst.ComparisonTarget(
|
||||
operator=cst.IsNot(), comparator=cst.Name(value="None")
|
||||
)
|
||||
],
|
||||
),
|
||||
body=cst.parse_statement('transaction_config["nonce"] = args.nonce'),
|
||||
),
|
||||
cst.parse_statement("return transaction_config"),
|
||||
],
|
||||
)
|
||||
|
@ -483,6 +497,9 @@ def generate_add_default_arguments() -> cst.FunctionDef:
|
|||
cst.parse_statement(
|
||||
'parser.add_argument("--confirmations", type=int, default=None, help="Number of confirmations to await before considering a transaction completed")'
|
||||
),
|
||||
cst.parse_statement(
|
||||
'parser.add_argument("--nonce", type=int, default=None, help="Nonce for the transaction (optional)")'
|
||||
),
|
||||
],
|
||||
)
|
||||
function_def = cst.FunctionDef(
|
||||
|
|
|
@ -1 +1 @@
|
|||
MOONWORM_VERSION = "0.1.8"
|
||||
MOONWORM_VERSION = "0.1.9"
|
||||
|
|
Ładowanie…
Reference in New Issue