Skip to content

Commit

Permalink
Fix rinkeby ERC20 gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
jiivan committed Dec 13, 2021
1 parent a5e7529 commit 1bdd83f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/payment-driver/erc20/src/erc20/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ pub async fn prepare_raw_transaction(
let data = eth_utils::contract_encode(&contract, TRANSFER_ERC20_FUNCTION, (recipient, amount))
.map_err(GenericError::new)?;

//get gas price from network in not provided
let gas_price = match gas_price_override {
Some(gas_price_new) => gas_price_new,
None => client.eth().gas_price().await.map_err(GenericError::new)?,
let gas_price = match network {
Network::Rinkeby => U256::from(1),
_ => {
//get gas price from network in not provided
match gas_price_override {
Some(gas_price_new) => gas_price_new,
None => client.eth().gas_price().await.map_err(GenericError::new)?,
}
},
};

let gas_limit = match gas_limit_override {
Expand Down

0 comments on commit 1bdd83f

Please sign in to comment.