Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Jul 21, 2023
1 parent 6866bcf commit 8b9f163
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cli/src/commands/developer/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Deploy {
query: String,
/// The priority fee in microcredits.
#[clap(short, long)]
priority_fee: u64,
fee: u64,
/// The record to spend the fee from.
#[clap(short, long)]
record: String,
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Deploy {
let (minimum_deployment_cost, (_, _)) = deployment_cost(&deployment)?;
// Determine the fee.
let fee_in_microcredits = minimum_deployment_cost
.checked_add(self.priority_fee)
.checked_add(self.fee)
.ok_or_else(|| anyhow!("Fee overflowed for a deployment transaction"))?;

// Prepare the fees.
Expand Down Expand Up @@ -153,7 +153,7 @@ mod tests {
assert_eq!(deploy.program_id, "hello.aleo".try_into().unwrap());
assert_eq!(deploy.private_key, "PRIVATE_KEY");
assert_eq!(deploy.query, "QUERY");
assert_eq!(deploy.priority_fee, 77);
assert_eq!(deploy.fee, 77);
assert_eq!(deploy.record, "RECORD");
} else {
panic!("Unexpected result of clap parsing!");
Expand Down
6 changes: 3 additions & 3 deletions cli/src/commands/developer/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct Execute {
query: String,
/// The priority fee in microcredits.
#[clap(short, long)]
priority_fee: Option<u64>,
fee: Option<u64>,
/// The record to spend the fee from.
#[clap(short, long)]
record: Option<String>,
Expand Down Expand Up @@ -107,7 +107,7 @@ impl Execute {
let fee = match self.record {
Some(record_string) => {
let fee_record = Developer::parse_record(&private_key, &record_string)?;
Some((fee_record, self.priority_fee.unwrap_or(0)))
Some((fee_record, self.fee.unwrap_or(0)))
}
None => {
// Ensure that only the `credits.aleo/split` call can be created without a fee.
Expand Down Expand Up @@ -159,7 +159,7 @@ mod tests {
if let Command::Developer(Developer::Execute(execute)) = cli.command {
assert_eq!(execute.private_key, "PRIVATE_KEY");
assert_eq!(execute.query, "QUERY");
assert_eq!(execute.priority_fee, Some(77));
assert_eq!(execute.fee, Some(77));
assert_eq!(execute.record, Some("RECORD".into()));
assert_eq!(execute.program_id, "hello.aleo".try_into().unwrap());
assert_eq!(execute.function, "hello".try_into().unwrap());
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/developer/transfer_private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct TransferPrivate {
query: String,
/// The priority fee in microcredits.
#[clap(short, long)]
priority_fee: u64,
fee: u64,
/// The record to spend the fee from.
#[clap(long)]
fee_record: String,
Expand Down Expand Up @@ -91,7 +91,7 @@ impl TransferPrivate {

// Prepare the fees.
let fee_record = Developer::parse_record(&private_key, &self.fee_record)?;
let fee = (fee_record, self.priority_fee);
let fee = (fee_record, self.fee);

// Prepare the inputs for a transfer.
let input_record = Developer::parse_record(&private_key, &self.input_record)?;
Expand Down

0 comments on commit 8b9f163

Please sign in to comment.