Skip to content

Commit

Permalink
Merge pull request #200 from casper-ecosystem/remove-gas-limit
Browse files Browse the repository at this point in the history
Remove --gas-limit parameter
  • Loading branch information
darthsiroftardis authored Nov 19, 2024
2 parents 94e3a69 + 7c00a51 commit 4f841da
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
14 changes: 0 additions & 14 deletions lib/cli/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -615,7 +614,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -695,7 +693,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -764,7 +761,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -850,7 +846,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -944,7 +939,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1004,7 +998,6 @@ mod transaction {
additional_computation_factor: "",
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1068,7 +1061,6 @@ mod transaction {
additional_computation_factor: "",
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1130,7 +1122,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1190,7 +1181,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1257,7 +1247,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1323,7 +1312,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1366,7 +1354,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down Expand Up @@ -1404,7 +1391,6 @@ mod transaction {
receipt: SAMPLE_DIGEST,
standard_payment: "true",
transferred_value: "0",
gas_limit: "",
session_entry_point: None,
chunked_args: None,
};
Expand Down
2 changes: 0 additions & 2 deletions lib/cli/transaction_str_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ pub struct TransactionStrParams<'a> {
pub receipt: &'a str,
/// Standard payment.
pub standard_payment: &'a str,
/// Gas limit for the transaction.
pub gas_limit: &'a str,
/// Transaferred value.
pub transferred_value: &'a str,
/// The entry point for the session.
Expand Down
33 changes: 0 additions & 33 deletions src/transaction/creation_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,35 +441,6 @@ pub(super) mod gas_price_tolerance {
}
}

pub(super) mod gas_limit {
use super::*;
pub(in crate::transaction) const ARG_NAME: &str = "gas-limit";

const ARG_VALUE_NAME: &str = common::ARG_INTEGER;

const ARG_ALIAS: &str = "gas-limit";
const ARG_SHORT: char = 'l';
const ARG_HELP: &str =
"The maximum amount of gas the user is willing to pay for the transaction";

pub(in crate::transaction) fn arg() -> Arg {
Arg::new(ARG_NAME)
.long(ARG_NAME)
.alias(ARG_ALIAS)
.short(ARG_SHORT)
.required(true)
.value_name(ARG_VALUE_NAME)
.help(ARG_HELP)
.display_order(DisplayOrder::GasPriceTolerance as usize)
}

pub fn get(matches: &ArgMatches) -> &str {
matches
.get_one::<String>(ARG_NAME)
.map(String::as_str)
.unwrap_or_default()
}
}
pub(super) mod transfer_amount {
use super::*;
pub(in crate::transaction) const ARG_NAME: &str = "transfer-amount";
Expand Down Expand Up @@ -1659,7 +1630,6 @@ pub(super) mod invocable_entity {
.arg(entity_addr::arg())
.arg(session_entry_point::arg())
.arg(transaction_runtime::arg())
.arg(gas_limit::arg())
.arg(transferred_value::arg())
.arg(chunked_args::arg())
}
Expand Down Expand Up @@ -1911,7 +1881,6 @@ pub(super) mod session {
DisplayOrder::IsInstallUpgrade as usize,
))
.arg(transaction_runtime::arg())
.arg(gas_limit::arg())
.arg(transferred_value::arg())
.arg(chunked_args::arg())
}
Expand Down Expand Up @@ -2095,7 +2064,6 @@ pub(super) fn build_transaction_str_params(
let payment_amount = payment_amount::get(matches);
let receipt = receipt::get(matches);
let standard_payment = standard_payment::get(matches);
let gas_limit = gas_limit::get(matches);

let maybe_output_path = output::get(matches).unwrap_or_default();
let initiator_addr = initiator_address::get(matches);
Expand Down Expand Up @@ -2123,7 +2091,6 @@ pub(super) fn build_transaction_str_params(
transferred_value: transferred_value::get(matches)
.map(|tv| tv.as_str())
.unwrap_or_default(),
gas_limit,
session_entry_point,
chunked_args,
}
Expand Down

0 comments on commit 4f841da

Please sign in to comment.