Skip to content

Commit

Permalink
Fix bug in send_eth
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferlund committed Nov 6, 2024
1 parent db4ddae commit 806e80c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/src/service/send_eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ async fn send_eth() -> Result<String, String> {
let wallet = EthereumWallet::from(signer);
let rpc_service = get_rpc_service_sepolia();
let config = IcpConfig::new(rpc_service);
let provider = ProviderBuilder::new().wallet(wallet).on_icp(config);
let provider = ProviderBuilder::new()
.with_gas_estimation()
.wallet(wallet)
.on_icp(config);

// Attempt to get nonce from thread-local storage
let maybe_nonce = NONCE.with_borrow(|maybe_nonce| {
Expand All @@ -65,7 +68,6 @@ async fn send_eth() -> Result<String, String> {
.with_to(address)
.with_value(U256::from(100))
.with_nonce(nonce)
.with_gas_limit(21_000)
.with_chain_id(11155111);

let transport_result = provider.send_transaction(tx.clone()).await;
Expand Down

0 comments on commit 806e80c

Please sign in to comment.