@@ -29,7 +29,6 @@ describe('GasUtils', () => {
29
29
let gasUtils : GasUtils ;
30
30
let publicClient : any ;
31
31
let walletClient : any ;
32
- let account : any ;
33
32
let anvil : Anvil ;
34
33
let initialBaseFee : bigint ;
35
34
const logger = createDebugLogger ( 'l1_gas_test' ) ;
@@ -43,7 +42,7 @@ describe('GasUtils', () => {
43
42
throw new Error ( 'Failed to get private key' ) ;
44
43
}
45
44
const privKey = Buffer . from ( privKeyRaw ) . toString ( 'hex' ) ;
46
- account = privateKeyToAccount ( `0x${ privKey } ` ) ;
45
+ const account = privateKeyToAccount ( `0x${ privKey } ` ) ;
47
46
48
47
publicClient = createPublicClient ( {
49
48
transport : http ( rpcUrl ) ,
@@ -58,6 +57,7 @@ describe('GasUtils', () => {
58
57
59
58
gasUtils = new GasUtils (
60
59
publicClient ,
60
+ walletClient ,
61
61
logger ,
62
62
{
63
63
bufferPercentage : 20n ,
@@ -77,7 +77,7 @@ describe('GasUtils', () => {
77
77
} , 5000 ) ;
78
78
79
79
it ( 'sends and monitors a simple transaction' , async ( ) => {
80
- const receipt = await gasUtils . sendAndMonitorTransaction ( walletClient , account , {
80
+ const receipt = await gasUtils . sendAndMonitorTransaction ( {
81
81
to : '0x1234567890123456789012345678901234567890' ,
82
82
data : '0x' ,
83
83
value : 0n ,
@@ -92,7 +92,7 @@ describe('GasUtils', () => {
92
92
initialBaseFee = initialBlock . baseFeePerGas ?? 0n ;
93
93
94
94
// Start a transaction
95
- const sendPromise = gasUtils . sendAndMonitorTransaction ( walletClient , account , {
95
+ const sendPromise = gasUtils . sendAndMonitorTransaction ( {
96
96
to : '0x1234567890123456789012345678901234567890' ,
97
97
data : '0x' ,
98
98
value : 0n ,
@@ -131,7 +131,7 @@ describe('GasUtils', () => {
131
131
params : [ ] ,
132
132
} ) ;
133
133
134
- const receipt = await gasUtils . sendAndMonitorTransaction ( walletClient , account , {
134
+ const receipt = await gasUtils . sendAndMonitorTransaction ( {
135
135
to : '0x1234567890123456789012345678901234567890' ,
136
136
data : '0x' ,
137
137
value : 0n ,
@@ -154,6 +154,7 @@ describe('GasUtils', () => {
154
154
// First deploy without any buffer
155
155
const baselineGasUtils = new GasUtils (
156
156
publicClient ,
157
+ walletClient ,
157
158
logger ,
158
159
{
159
160
bufferPercentage : 0n ,
@@ -168,7 +169,7 @@ describe('GasUtils', () => {
168
169
} ,
169
170
) ;
170
171
171
- const baselineTx = await baselineGasUtils . sendAndMonitorTransaction ( walletClient , account , {
172
+ const baselineTx = await baselineGasUtils . sendAndMonitorTransaction ( {
172
173
to : EthAddress . ZERO . toString ( ) ,
173
174
data : SIMPLE_CONTRACT_BYTECODE ,
174
175
} ) ;
@@ -181,6 +182,7 @@ describe('GasUtils', () => {
181
182
// Now deploy with 20% buffer
182
183
const bufferedGasUtils = new GasUtils (
183
184
publicClient ,
185
+ walletClient ,
184
186
logger ,
185
187
{
186
188
bufferPercentage : 20n ,
@@ -195,7 +197,7 @@ describe('GasUtils', () => {
195
197
} ,
196
198
) ;
197
199
198
- const bufferedTx = await bufferedGasUtils . sendAndMonitorTransaction ( walletClient , account , {
200
+ const bufferedTx = await bufferedGasUtils . sendAndMonitorTransaction ( {
199
201
to : EthAddress . ZERO . toString ( ) ,
200
202
data : SIMPLE_CONTRACT_BYTECODE ,
201
203
} ) ;
0 commit comments