Skip to content

Commit

Permalink
Fix transaction error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Lelek authored and kacperzuk-neti committed Sep 20, 2024
1 parent a40c890 commit f5cd76f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fplus-lib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn default_env_vars() -> &'static HashMap<&'static str, &'static str> {
"ALLOCATOR_CONTRACT_ADDRESS",
"0x640bD4be149f40714D95aBcD414338bc7CfF39a3",
);
m.insert("AUTOALLOCATION_AMOUNT", "68719476736"); // 68719476736 B == 64 GB
m.insert("AUTOALLOCATION_AMOUNT", "68719476736"); // 68719476736 B == 64 GiB
m
})
}
Expand Down
7 changes: 5 additions & 2 deletions fplus-lib/src/core/autoallocator/metaallocator_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ pub async fn add_verified_client(address: &str, amount: &u64) -> Result<(), LDNE
.with_input(input)
.with_gas_limit(45_000_000);

provider
let tx = provider
.send_transaction(tx)
.await
.map_err(|e| LDNError::New(format!("RPC error: {}", e)))?
.watch()
.get_receipt()
.await
.map_err(|e| LDNError::New(format!("Transaction failed: {}", e)))?;
if !tx.status() {
return Err(LDNError::New("Transaction failed.".to_string()));
}
Ok(())
}

Expand Down

0 comments on commit f5cd76f

Please sign in to comment.