Added EIP1559 parameters to generated CLI for brownie projects

Tested on Moonstream DAO repo (successfully):
https://github.com/bugout-dev/dao/pull/30
pull/53/head
Neeraj Kashyap 2022-01-25 22:00:59 -08:00
rodzic d8da821a16
commit 239257f415
2 zmienionych plików z 37 dodań i 1 usunięć

Wyświetl plik

@ -246,6 +246,36 @@ def generate_get_transaction_config() -> cst.FunctionDef:
'transaction_config["gas_price"] = args.gas_price'
),
),
cst.If(
test=cst.Comparison(
left=cst.Attribute(
attr=cst.Name(value="max_fee_per_gas"), value=cst.Name(value="args")
),
comparisons=[
cst.ComparisonTarget(
operator=cst.IsNot(), comparator=cst.Name(value="None")
)
],
),
body=cst.parse_statement(
'transaction_config["max_fee"] = args.max_fee_per_gas'
),
),
cst.If(
test=cst.Comparison(
left=cst.Attribute(
attr=cst.Name(value="max_priority_fee_per_gas"), value=cst.Name(value="args")
),
comparisons=[
cst.ComparisonTarget(
operator=cst.IsNot(), comparator=cst.Name(value="None")
)
],
),
body=cst.parse_statement(
'transaction_config["priority_fee"] = args.max_priority_fee_per_gas'
),
),
cst.If(
test=cst.Comparison(
left=cst.Attribute(
@ -571,6 +601,12 @@ def generate_add_default_arguments() -> cst.FunctionDef:
cst.parse_statement(
'parser.add_argument("--gas-price", default=None, help="Gas price at which to submit transaction")'
),
cst.parse_statement(
'parser.add_argument("--max-fee-per-gas", default=None, help="Max fee per gas for EIP1559 transactions")'
),
cst.parse_statement(
'parser.add_argument("--max-priority-fee-per-gas", default=None, help="Max priority fee per gas for EIP1559 transactions")'
),
cst.parse_statement(
'parser.add_argument("--confirmations", type=int, default=None, help="Number of confirmations to await before considering a transaction completed")'
),

Wyświetl plik

@ -1 +1 @@
MOONWORM_VERSION = "0.1.13"
MOONWORM_VERSION = "0.1.14"