Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions e2e/tests/providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,20 +1248,22 @@ async fn tx_respects_policies() -> Result<()> {
}

#[tokio::test]
#[ignore] // TODO: https://github.com/FuelLabs/fuels-rs/issues/1581
async fn can_setup_static_gas_price() -> Result<()> {
let expected_gas_price = 474;
let node_config = NodeConfig {
starting_gas_price: expected_gas_price,
gas_price_change_percent: 0,
..Default::default()
};
let provider = setup_test_provider(vec![], vec![], Some(node_config), None).await?;

let gas_price = provider.estimate_gas_price(0).await?.gas_price;

let da_cost = 1000;
assert_eq!(gas_price, da_cost + expected_gas_price);

provider.produce_blocks(10, None).await?;
let gas_price_after_blocks = provider.estimate_gas_price(0).await?.gas_price;
assert_eq!(gas_price, gas_price_after_blocks);
Ok(())
}

Expand Down
5 changes: 5 additions & 0 deletions packages/fuels-test-helpers/src/fuel_bin_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ impl ExtendedConfig {
self.node_config.starting_gas_price
));

args.push(format!(
"--gas-price-change-percent={}",
self.node_config.gas_price_change_percent
));

Ok(args)
}

Expand Down
2 changes: 2 additions & 0 deletions packages/fuels-test-helpers/src/node_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct NodeConfig {
pub vm_backtrace: bool,
pub silent: bool,
pub starting_gas_price: u64,
pub gas_price_change_percent: u64,
pub graphql_request_body_bytes_limit: u64,
}

Expand All @@ -70,6 +71,7 @@ impl Default for NodeConfig {
vm_backtrace: false,
silent: true,
starting_gas_price: 1,
gas_price_change_percent: 0,
graphql_request_body_bytes_limit: u64::MAX,
}
}
Expand Down
Loading