-
Notifications
You must be signed in to change notification settings - Fork 29
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
[rust-legacy-cli] Add scaled ui amount extension #93
base: main
Are you sure you want to change the base?
[rust-legacy-cli] Add scaled ui amount extension #93
Conversation
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.
Mostly tiny nits, feel free to take or leave them. Thanks for doing this!
clients/cli/src/clap_app.rs
Outdated
Arg::with_name("ui_multiplier") | ||
.long("ui-multiplier") | ||
.value_name("UI_MULTIPLIER") |
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.
nit: about being a little more verbose and say ui-amount-multiplier
?
Arg::with_name("ui_multiplier") | |
.long("ui-multiplier") | |
.value_name("UI_MULTIPLIER") | |
Arg::with_name("ui_amount_multiplier") | |
.long("ui-amount-multiplier") | |
.value_name("MULTIPLIER") |
clients/cli/src/clap_app.rs
Outdated
@@ -2688,4 +2703,46 @@ pub fn app<'a>( | |||
.arg(multisig_signer_arg()) | |||
.nonce_args(true) | |||
) | |||
.subcommand( | |||
SubCommand::with_name(CommandName::UpdateUiMultiplier.into()) |
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.
nit: same here UpdateUiAmountMultiplier
clients/cli/src/clap_app.rs
Outdated
Arg::with_name("ui-multiplier") | ||
.value_name("MULTIPLIER") |
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.
nit: we typically use underscores in the arg name, but maybe we can simplify it to multiplier
while we're at it?
Arg::with_name("ui-multiplier") | |
.value_name("MULTIPLIER") | |
Arg::with_name("multiplier") | |
.value_name("MULTIPLIER") |
clients/cli/src/clap_app.rs
Outdated
Arg::with_name("multiplier_authority") | ||
.long("multiplier-authority") |
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.
nit: feel free to disagree, but since it's called ScaledUiAmount
elsewhere, maybe we should mirror that
Arg::with_name("multiplier_authority") | |
.long("multiplier-authority") | |
Arg::with_name("ui_amount_authority") | |
.long("ui-amount-authority") |
clients/cli/src/clap_app.rs
Outdated
Arg::with_name("timestamp") | ||
.value_name("TIMESTAMP") | ||
.takes_value(true) | ||
.index(3) | ||
.required(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.
I don't feel too strongly about this, but what do you think about making this arg optional and defaulting the current time?
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.
Yes I think this is a good idea. I updated in e8b982e.
// disable authority | ||
process_test_command( | ||
&config, | ||
payer, | ||
&[ | ||
"spl-token", | ||
CommandName::Authorize.into(), | ||
&token_pubkey.to_string(), | ||
"scaled-ui-amount", | ||
"--disable", | ||
], | ||
) | ||
.await | ||
.unwrap(); |
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.
Should this check that the authority is None
aftewards?
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.
Good call! This check was missing for the confidential transfer test, so I added it there too as well as in the other PR for the pausable extension.
Co-authored-by: Jon C <[email protected]>
Co-authored-by: Jon C <[email protected]>
e8b982e
to
17b2216
Compare
Problem
The rust legacy cli does not yet have support for the scaled ui amount extension.
Summary of Changes
Added support for the scaled ui amount extension.
i64
and printed out asi64
. If you have a different suggestion, please let me know.