Skip to content

Commit

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

// Prepare the fees.
Expand Down Expand Up @@ -155,7 +155,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.additional_fee, 77);
assert_eq!(deploy.priority_fee, 77);
assert_eq!(deploy.record, "RECORD");
} else {
panic!("Unexpected result of clap parsing!");
Expand Down
8 changes: 4 additions & 4 deletions cli/src/commands/developer/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ pub struct Execute {
/// The endpoint to query node state from.
#[clap(short, long)]
query: String,
/// The transaction fee in microcredits.
/// The priority fee in microcredits.
#[clap(short, long)]
fee: Option<u64>,
priority_fee: Option<u64>,
/// The record to spend the fee from.
#[clap(short, long)]
record: Option<String>,
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Execute {
let fee = match self.record {
Some(record) => Some((
Record::<CurrentNetwork, Plaintext<CurrentNetwork>>::from_str(&record)?,
self.fee.unwrap_or(0),
self.priority_fee.unwrap_or(0),
)),
None => {
// Ensure that only the `credits.aleo/split` call can be created without a fee.
Expand Down Expand Up @@ -166,7 +166,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.fee, Some(77));
assert_eq!(execute.priority_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
7 changes: 4 additions & 3 deletions cli/src/commands/developer/transfer_private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ pub struct TransferPrivate {
/// The endpoint to query node state from.
#[clap(short, long)]
query: String,
/// The transaction fee in microcredits.
/// The priority fee in microcredits.
#[clap(short, long)]
fee: u64,
priority_fee: u64,
/// The record to spend the fee from.
#[clap(long)]
fee_record: String,
Expand Down Expand Up @@ -92,7 +92,8 @@ impl TransferPrivate {
let vm = VM::from(store)?;

// Prepare the fees.
let fee = (Record::<CurrentNetwork, Plaintext<CurrentNetwork>>::from_str(&self.fee_record)?, self.fee);
let fee =
(Record::<CurrentNetwork, Plaintext<CurrentNetwork>>::from_str(&self.fee_record)?, self.priority_fee);

// Prepare the inputs for a transfer.
let inputs = vec![
Expand Down

0 comments on commit c940aa4

Please sign in to comment.