Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rinkeby ERC20 gas price #1763

Merged
merged 3 commits into from
Dec 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//get gas price from network in not provided
// get gas price from network if 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