@@ -5,7 +5,6 @@ import { go, goSync } from '@api3/promise-utils';
5
5
import { ethers } from 'ethers' ;
6
6
import { uniq } from 'lodash' ;
7
7
import { LogOptionsOverride , logger } from './logging' ;
8
- import { RateLimitedProvider } from './providers' ;
9
8
import { Provider , SponsorWalletsPrivateKey , getState , updateState } from './state' ;
10
9
import { createDummyBeaconUpdateData , shortenAddress } from './utils' ;
11
10
import { DataFeedUpdates } from './validation' ;
@@ -61,26 +60,6 @@ export const retrieveSponsorWallet = (sponsorAddress: string): ethers.Wallet =>
61
60
return new ethers . Wallet ( sponsorWalletsPrivateKey [ sponsorAddress ] ) ;
62
61
} ;
63
62
64
- const getMantleGasPrice = async ( provider : RateLimitedProvider ) => {
65
- const goRes = await go ( ( ) => provider . send ( 'rollup_gasPrices' , [ ] ) ) ;
66
- if ( ! goRes . success ) throw goRes . error ;
67
-
68
- const l1GasPrice = ethers . BigNumber . from ( goRes . data . l1GasPrice ) ;
69
- const l2GasPrice = ethers . BigNumber . from ( goRes . data . l2GasPrice ) ;
70
-
71
- return l1GasPrice . add ( l2GasPrice ) ;
72
- } ;
73
-
74
- const getGasPrice = async ( provider : RateLimitedProvider ) => {
75
- switch ( provider . network . chainId ) {
76
- case 5000 :
77
- case 5001 :
78
- return getMantleGasPrice ( provider ) ;
79
- default :
80
- return provider . getGasPrice ( ) ;
81
- }
82
- } ;
83
-
84
63
export const hasEnoughBalance = async (
85
64
sponsorWallet : ethers . Wallet ,
86
65
dummyAirnode : ethers . Wallet ,
@@ -97,7 +76,7 @@ export const hasEnoughBalance = async (
97
76
const balance = goGetBalance . data ;
98
77
99
78
// Get the gas price from provider
100
- const goGasPrice = await go ( ( ) => getGasPrice ( sponsorWallet . provider as RateLimitedProvider ) , { retries : 1 } ) ;
79
+ const goGasPrice = await go ( ( ) => sponsorWallet . provider . getGasPrice ( ) , { retries : 1 } ) ;
101
80
if ( ! goGasPrice . success ) {
102
81
logger . error ( 'Failed to get chain gas price' , goGasPrice . error , logOptions ) ;
103
82
throw new Error ( goGasPrice . error . message ) ;
0 commit comments