diff --git a/.changelog/unreleased/features/775-rename-cli-fee-args.md b/.changelog/unreleased/features/775-rename-cli-fee-args.md new file mode 100644 index 00000000000..a81f75ef418 --- /dev/null +++ b/.changelog/unreleased/features/775-rename-cli-fee-args.md @@ -0,0 +1,2 @@ +- Renamed transaction CLI arguments `--fee-amount` and `--fee-token` to `--gas- + amount` and `--gas-token`. ([#775](https://github.com/anoma/namada/pull/775)) diff --git a/apps/src/lib/cli.rs b/apps/src/lib/cli.rs index 22ac4d9421f..512e82361ee 100644 --- a/apps/src/lib/cli.rs +++ b/apps/src/lib/cli.rs @@ -1504,14 +1504,14 @@ pub mod args { const DONT_ARCHIVE: ArgFlag = flag("dont-archive"); const DRY_RUN_TX: ArgFlag = flag("dry-run"); const EPOCH: ArgOpt = arg_opt("epoch"); - const FEE_AMOUNT: ArgDefault = - arg_default("fee-amount", DefaultFn(|| token::Amount::from(0))); - const FEE_TOKEN: ArgDefaultFromCtx = - arg_default_from_ctx("fee-token", DefaultFn(|| "NAM".into())); const FORCE: ArgFlag = flag("force"); const DONT_PREFETCH_WASM: ArgFlag = flag("dont-prefetch-wasm"); + const GAS_AMOUNT: ArgDefault = + arg_default("gas-amount", DefaultFn(|| token::Amount::from(0))); const GAS_LIMIT: ArgDefault = arg_default("gas-limit", DefaultFn(|| token::Amount::from(0))); + const GAS_TOKEN: ArgDefaultFromCtx = + arg_default_from_ctx("gas-token", DefaultFn(|| "NAM".into())); const GENESIS_PATH: Arg = arg("genesis-path"); const GENESIS_VALIDATOR: ArgOpt = arg("genesis-validator").opt(); const LEDGER_ADDRESS_ABOUT: &str = @@ -2613,10 +2613,10 @@ pub mod args { initialized, the alias will be the prefix of each new \ address joined with a number.", )) - .arg(FEE_AMOUNT.def().about( + .arg(GAS_AMOUNT.def().about( "The amount being paid for the inclusion of this transaction", )) - .arg(FEE_TOKEN.def().about("The token for paying the fee")) + .arg(GAS_TOKEN.def().about("The token for paying the gas")) .arg( GAS_LIMIT.def().about( "The maximum amount of gas needed to run transaction", @@ -2649,8 +2649,8 @@ pub mod args { let broadcast_only = BROADCAST_ONLY.parse(matches); let ledger_address = LEDGER_ADDRESS_DEFAULT.parse(matches); let initialized_account_alias = ALIAS_OPT.parse(matches); - let fee_amount = FEE_AMOUNT.parse(matches); - let fee_token = FEE_TOKEN.parse(matches); + let fee_amount = GAS_AMOUNT.parse(matches); + let fee_token = GAS_TOKEN.parse(matches); let gas_limit = GAS_LIMIT.parse(matches).into(); let signing_key = SIGNING_KEY_OPT.parse(matches); diff --git a/tests/src/e2e/ibc_tests.rs b/tests/src/e2e/ibc_tests.rs index 550a59efecb..189faed8e95 100644 --- a/tests/src/e2e/ibc_tests.rs +++ b/tests/src/e2e/ibc_tests.rs @@ -769,11 +769,11 @@ fn transfer_received_token( &sub_prefix, "--amount", "50000", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &rpc, @@ -1060,11 +1060,11 @@ fn submit_ibc_tx( &data_path, "--signer", signer, - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &rpc diff --git a/tests/src/e2e/ledger_tests.rs b/tests/src/e2e/ledger_tests.rs index 43eb60d337c..0641178bc5d 100644 --- a/tests/src/e2e/ledger_tests.rs +++ b/tests/src/e2e/ledger_tests.rs @@ -109,11 +109,11 @@ fn test_node_connectivity_and_consensus() -> Result<()> { NAM, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -302,11 +302,11 @@ fn ledger_txs_and_queries() -> Result<()> { NAM, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -319,11 +319,11 @@ fn ledger_txs_and_queries() -> Result<()> { BERTHA, "--code-path", &vp_user, - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -337,11 +337,11 @@ fn ledger_txs_and_queries() -> Result<()> { &tx_no_op, "--data-path", "README.md", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc @@ -358,11 +358,11 @@ fn ledger_txs_and_queries() -> Result<()> { &vp_user, "--alias", "Test-Account", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1621,11 +1621,11 @@ fn invalid_transactions() -> Result<()> { &tx_data_path, "--signing-key", &daewon_lower, - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1676,11 +1676,11 @@ fn invalid_transactions() -> Result<()> { BERTHA, "--amount", "1_000_000.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, // Force to ignore client check that fails on the balance check of the // source address @@ -1752,11 +1752,11 @@ fn pos_bonds() -> Result<()> { "validator-0", "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1775,11 +1775,11 @@ fn pos_bonds() -> Result<()> { BERTHA, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1795,11 +1795,11 @@ fn pos_bonds() -> Result<()> { "validator-0", "--amount", "5.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1818,11 +1818,11 @@ fn pos_bonds() -> Result<()> { BERTHA, "--amount", "3.2", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1858,11 +1858,11 @@ fn pos_bonds() -> Result<()> { "withdraw", "--validator", "validator-0", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1879,11 +1879,11 @@ fn pos_bonds() -> Result<()> { "validator-0", "--source", BERTHA, - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1948,11 +1948,11 @@ fn pos_init_validator() -> Result<()> { "--source", BERTHA, "--unsafe-dont-encrypt", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1973,11 +1973,11 @@ fn pos_init_validator() -> Result<()> { NAM, "--amount", "0.5", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -1994,11 +1994,11 @@ fn pos_init_validator() -> Result<()> { BERTHA, "--amount", "1000.5", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -2018,11 +2018,11 @@ fn pos_init_validator() -> Result<()> { NAM, "--amount", "10999.5", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -2038,11 +2038,11 @@ fn pos_init_validator() -> Result<()> { new_validator, "--amount", "10000", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -2114,11 +2114,11 @@ fn ledger_many_txs_in_a_block() -> Result<()> { NAM, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", ]); @@ -2223,11 +2223,11 @@ fn proposal_submission() -> Result<()> { BERTHA, "--amount", "900", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -2572,11 +2572,11 @@ fn proposal_offline() -> Result<()> { ALBERT, "--amount", "900", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -3015,11 +3015,11 @@ fn test_genesis_validators() -> Result<()> { NAM, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc, @@ -3191,11 +3191,11 @@ fn double_signing_gets_slashed() -> Result<()> { NAM, "--amount", "10.1", - "--fee-amount", + "--gas-amount", "0", "--gas-limit", "0", - "--fee-token", + "--gas-token", NAM, "--ledger-address", &validator_one_rpc,