Skip to content

Commit

Permalink
fix: legacy view-function call with --base64 was not recognized (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
FroVolod committed Sep 3, 2023
1 parent 312bca1 commit ab6cf46
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/js_command_match/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
pub struct CallArgs {
contract_account_id: String,
method_name: String,
#[clap(long, default_value_t = false)]
base64: bool,
args: String,
#[clap(long, aliases = ["account_id", "accountId"])]
account_id: String,
Expand All @@ -16,13 +18,18 @@ pub struct CallArgs {

impl CallArgs {
pub fn to_cli_args(&self, network_config: String) -> Vec<String> {
let format_args = if self.base64 {
"base64-args"
} else {
"json-args"
};
vec![
"contract".to_owned(),
"call-function".to_owned(),
"as-transaction".to_owned(),
self.contract_account_id.to_owned(),
self.method_name.to_owned(),
"json-args".to_owned(),
format_args.to_owned(),
self.args.to_owned(),
"prepaid-gas".to_owned(),
format!("{} TeraGas", self.gas / 1_000_000_000_000),
Expand Down

0 comments on commit ab6cf46

Please sign in to comment.