Skip to content

Commit

Permalink
fix sign test
Browse files Browse the repository at this point in the history
  • Loading branch information
MujkicA committed Sep 19, 2023
1 parent 7f8321c commit 346620b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/fuels-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
13 changes: 7 additions & 6 deletions packages/fuels-core/src/types/transaction_builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub trait TransactionBuilder: Send {
fn fee_checked_from_tx(&self, params: &ConsensusParameters) -> Result<Option<TransactionFee>>;
fn with_maturity(self, maturity: u32) -> Self;
fn with_gas_price(self, gas_price: u64) -> Self;
fn with_gas_limit(self, gas_limit: Option<u64>) -> 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<Input>) -> Self;
fn with_outputs(self, outputs: Vec<Output>) -> Self;
Expand Down Expand Up @@ -109,14 +109,15 @@ macro_rules! impl_tx_trait {
self
}

fn with_gas_limit(mut self, gas_limit: Option<u64>) -> 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())
}

Expand Down
5 changes: 4 additions & 1 deletion packages/fuels-core/src/types/wrappers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 346620b

Please sign in to comment.