Skip to content

Commit

Permalink
Fix clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Mar 2, 2023
1 parent 886d481 commit 340b477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chains/ethereum/server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ fn effective_gas_price(tx: &Transaction, base_fee: Option<U256>) -> Result<U256>
.transaction_type
.context("transaction type is not available")?;
let tx_gas_price = tx.gas_price.context("gas price is not available")?;
let tx_max_priority_fee_per_gas = tx.max_priority_fee_per_gas.unwrap_or(U256::from(0));
let tx_max_priority_fee_per_gas = tx.max_priority_fee_per_gas.unwrap_or_default();

if tx_transaction_type.as_u64() != 2 {
return Ok(tx_gas_price);
Expand Down
8 changes: 3 additions & 5 deletions chains/ethereum/tx/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::{anyhow, Context, Result};
use ethers::abi::token::{LenientTokenizer, Tokenizer};
use ethers::abi::{Abi, Function, HumanReadableParser, Param, Token};
use ethers_core::types::{Eip1559TransactionRequest, Signature, H160, U256};
Expand Down Expand Up @@ -31,10 +31,8 @@ impl TransactionBuilder for EthereumTransactionBuilder {

let method_str = params["method_signature"]
.as_str()
.ok_or(anyhow!("Method signature not found"))?;
let function_params = params["params"]
.as_array()
.ok_or(anyhow!("Params not found"))?;
.context("Method signature not found")?;
let function_params = params["params"].as_array().context("Params not found")?;

let function = parse_method(method_str)?;

Expand Down

0 comments on commit 340b477

Please sign in to comment.