Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 04b2e35

Browse files
azteca1998fannyguthmann
authored andcommitted
Fix gas/fee price type consistency (to u128). (#987)
1 parent dd91b4f commit 04b2e35

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

rpc_state_reader/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl RpcState {
341341
.to_string()
342342
.parse::<u64>()
343343
.unwrap(),
344-
gas_price: *starknet_os_config.gas_price() as u64,
344+
gas_price: *starknet_os_config.gas_price(),
345345
sequencer_address: starknet_os_config.fee_token_address().clone(),
346346
}
347347
}
@@ -569,7 +569,7 @@ mod tests {
569569
.to_string()
570570
.parse::<u64>()
571571
.unwrap(),
572-
gas_price: gas_price_u128 as u64,
572+
gas_price: gas_price_u128,
573573
sequencer_address: fee_token_address,
574574
};
575575

src/definitions/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub static ref DECLARE_VERSION: Felt252 = 2.into();
8282
pub static ref TRANSACTION_VERSION: Felt252 = 1.into();
8383
}
8484

85-
pub const DEFAULT_GAS_PRICE: u64 = 100_000_000_000; // 100 * 10**9
85+
pub const DEFAULT_GAS_PRICE: u128 = 100_000_000_000; // 100 * 10**9
8686
pub const DEFAULT_CONTRACT_STORAGE_COMMITMENT_TREE_HEIGHT: u64 = 251;
8787
pub const DEFAULT_GLOBAL_STATE_COMMITMENT_TREE_HEIGHT: u64 = 251;
8888
pub const DEFAULT_INVOKE_TX_MAX_N_STEPS: u64 = 1000000;

src/state/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct BlockInfo {
2929
/// Timestamp of the beginning of the last block creation attempt.
3030
pub block_timestamp: u64,
3131
/// L1 gas price (in Wei) measured at the beginning of the last block creation attempt.
32-
pub gas_price: u64,
32+
pub gas_price: u128,
3333
/// The sequencer address of this block.
3434
pub sequencer_address: Address,
3535
}

tests/internals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ fn expected_validate_call_info(
418418
fn expected_fee_transfer_call_info(
419419
block_context: &BlockContext,
420420
account_address: &Address,
421-
actual_fee: u64,
421+
actual_fee: u128,
422422
) -> CallInfo {
423423
CallInfo {
424424
entry_point_type: EntryPointType::External.into(),
@@ -1502,7 +1502,7 @@ fn test_deploy_account() {
15021502
let expected_fee_transfer_call_info = expected_fee_transfer_call_info(
15031503
&block_context,
15041504
deploy_account_tx.contract_address(),
1505-
expected_fee as u64,
1505+
expected_fee,
15061506
);
15071507

15081508
let resources = HashMap::from([

0 commit comments

Comments
 (0)