Closed igamigo closed 4 months ago
small consideration, what happens for commands that take 2 or more accounts (e.g mint/p2id/p2idr)? should it be used as a default for both values? That is:
Now the account args should be with flags rather than positional. For example, suppose the default account id is 0x0123456789
and we want to do a transfer to 0x9876543210
of an asset from a faucet with id 0x00000001
. We'd go from
cargo run --release --features testing,concurrent tx new mint 0x0123456789 0x9876543210 0x00000001 50 --note-type private
to:
cargo run --release --features testing,concurrent tx new mint 50 --target 0x9876543210 --faucet 0x00000001 --note-type private
Should we have one default faucet and one default regular account?
I would use default account only as the sender - i.e., if the sender is not provided, we use the default account for it (if one is set).
I do like the idea of using flags to indicate who is the sender and who is the recipient. We could use:
--source
for the source account (e.g., for P2ID
notes).--target
for the recipient.--faucet
for mint
transactions (as you have above).For faucet-related commends, I'm not sure default account should be taken into consideration. So, the mint
command would always require --faucet
and --target
flags.
closing as the PR got merged
Create a command for supporting default accounts on the CLI. That is, setting an account against which every transaction will be executed (and it would not have to be specified as a parameter). As part of this we should also refactor commands to always take the executor account as the first parameter instead of it depending on the transaction type (right now,
mint
andp2id
utilize different ordering of parameters)