|
43 | 43 | topic2 = evm.Hash{33, 1, 33} |
44 | 44 | topic3 = evm.Hash{20, 19, 17} |
45 | 45 | gas = uint64(10) |
| 46 | + l1Fee = big.NewInt(9876) |
46 | 47 | txHash = evm.Hash{5, 3, 44} |
47 | 48 | eventSigHash = evm.Hash{14, 16, 29} |
48 | 49 | filterName = "f name 1" |
@@ -246,6 +247,7 @@ func Test_EVMDomainRoundTripThroughGRPC(t *testing.T) { |
246 | 247 | GasUsed: gas, |
247 | 248 | BlockNumber: blockNum, |
248 | 249 | TransactionIndex: uint64(txIndex), |
| 250 | + L1Fee: l1Fee, |
249 | 251 | } |
250 | 252 | evmService.EXPECT().GetTransactionReceipt(mock.Anything, evm.GeTransactionReceiptRequest{Hash: txHash}).Return(expReceipt, nil).Once() |
251 | 253 |
|
@@ -340,6 +342,19 @@ func Test_EVMDomainRoundTripThroughGRPC(t *testing.T) { |
340 | 342 | require.NoError(t, err) |
341 | 343 | require.Equal(t, expectedNames, actualNames) |
342 | 344 | }) |
| 345 | + |
| 346 | + t.Run("CalculateTransactionFee", func(t *testing.T) { |
| 347 | + gasInfo := evm.ReceiptGasInfo{ |
| 348 | + GasUsed: gas, |
| 349 | + EffectiveGasPrice: gasPrice, |
| 350 | + L1Fee: l1Fee, |
| 351 | + } |
| 352 | + evmService.EXPECT().CalculateTransactionFee(mock.Anything, gasInfo).Return(&evm.TransactionFee{TransactionFee: txFee}, nil).Once() |
| 353 | + |
| 354 | + got, err := client.CalculateTransactionFee(ctx, gasInfo) |
| 355 | + require.NoError(t, err) |
| 356 | + require.Equal(t, txFee, got.TransactionFee) |
| 357 | + }) |
343 | 358 | } |
344 | 359 |
|
345 | 360 | func generateFixtureQuery() []query.Expression { |
|
0 commit comments