diff --git a/packages/fuels-accounts/src/lib.rs b/packages/fuels-accounts/src/lib.rs index 8ea265a590..1c4ad1f9da 100644 --- a/packages/fuels-accounts/src/lib.rs +++ b/packages/fuels-accounts/src/lib.rs @@ -417,7 +417,7 @@ mod tests { assert_eq!(signature, tx_signature); // Check if the signature is what we expect it to be - assert_eq!(signature, Signature::from_str("d7027be16db0aada625ac8cd438f9b6187bd74465495ba39511c1ad72b7bb10af4ef582c94cc33433f7a1eb4f2ad21c471473947f5f645e90924ba273e2cee7f")?); + assert_eq!(signature, Signature::from_str("df91e8ae723165f9a28b70910e3da41300da413607065618522f3084c9f051114acb1b51a836bd63c3d84a1ac904bf37b82ef03973c19026b266d04872f170a6")?); // Recover the address that signed the transaction let recovered_address = signature.recover(&message)?; diff --git a/packages/fuels-core/src/types/transaction_builders.rs b/packages/fuels-core/src/types/transaction_builders.rs index 75257825e0..ff9d89d9da 100644 --- a/packages/fuels-core/src/types/transaction_builders.rs +++ b/packages/fuels-core/src/types/transaction_builders.rs @@ -42,7 +42,7 @@ pub trait TransactionBuilder: Send { fn fee_checked_from_tx(&self, params: &ConsensusParameters) -> Result>; fn with_maturity(self, maturity: u32) -> Self; fn with_gas_price(self, gas_price: u64) -> Self; - fn with_gas_limit(self, gas_limit: Option) -> Self; + fn with_gas_limit(self, gas_limit: u64) -> Self; fn with_tx_params(self, tx_params: TxParameters) -> Self; fn with_inputs(self, inputs: Vec) -> Self; fn with_outputs(self, outputs: Vec) -> Self; @@ -109,14 +109,15 @@ macro_rules! impl_tx_trait { self } - fn with_gas_limit(mut self, gas_limit: Option) -> Self { - self.gas_limit = gas_limit; + fn with_gas_limit(mut self, gas_limit: u64) -> Self { + self.gas_limit = Some(gas_limit); self } - fn with_tx_params(self, tx_params: TxParameters) -> Self { - self.with_gas_limit(tx_params.gas_limit()) - .with_gas_price(tx_params.gas_price()) + fn with_tx_params(mut self, tx_params: TxParameters) -> Self { + self.gas_limit = tx_params.gas_limit(); + + self.with_gas_price(tx_params.gas_price()) .with_maturity(tx_params.maturity().into()) } diff --git a/packages/fuels-core/src/types/wrappers/transaction.rs b/packages/fuels-core/src/types/wrappers/transaction.rs index 379c3dd92b..0296c23632 100644 --- a/packages/fuels-core/src/types/wrappers/transaction.rs +++ b/packages/fuels-core/src/types/wrappers/transaction.rs @@ -10,7 +10,10 @@ use fuel_tx::{ }; use fuel_types::ChainId; -use crate::{types::Result, constants::{DEFAULT_GAS_PRICE, DEFAULT_MATURITY}}; +use crate::{ + constants::{DEFAULT_GAS_PRICE, DEFAULT_MATURITY}, + types::Result, +}; #[derive(Debug, Copy, Clone)] pub struct TxParameters {