Skip to content

Commit

Permalink
Add nonce in tx after estimating gas (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
haider-rs authored Jun 13, 2024
1 parent 2c13f4f commit a0e55f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chains/ethereum/server/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ where
} else {
self.backend.get_transaction_count(from, AtBlock::Latest).await?
};
let tx = CallRequest {
let mut tx = CallRequest {
from: Some(from),
to,
gas_limit: None,
gas_price: None,
value: Some(U256(options.amount)),
data: Some(options.data.clone().into()),
nonce: Some(nonce),
nonce: None,
chain_id: None, // Astar doesn't support this field for eth_call
max_priority_fee_per_gas: Some(max_priority_fee_per_gas),
access_list: AccessList::default(),
Expand All @@ -325,6 +325,8 @@ where
u64::try_from(gas_limit).unwrap_or(u64::MAX)
};

tx.nonce = Some(nonce);

Ok(EthereumMetadata {
chain_id,
nonce,
Expand Down

0 comments on commit a0e55f5

Please sign in to comment.