Add block param to EthEstimateGas

This commit is contained in:
Fridrik Asmundsson committed 2023-11-28 14:57:05 +00:00
1 parent 3d5bebc2dd
commit 717d2a0eeb
18 files changed
+43 -37

No files matched your search

+1 -1
View File
@@ -275,7 +275,7 @@ func TestEthAccountAbstractionFailsFromEvmActor(t *testing.T) {
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
+3 -3
View File
@@ -35,7 +35,7 @@ type ethAPIRaw struct {
EthBlockNumber func(context.Context) (json.RawMessage, error)
EthCall func(context.Context, ethtypes.EthCall, ethtypes.EthBlockNumberOrHash) (json.RawMessage, error)
EthChainId func(context.Context) (json.RawMessage, error)
EthEstimateGas func(context.Context, ethtypes.EthCall) (json.RawMessage, error)
EthEstimateGas func(context.Context, ethtypes.EthCall, ethtypes.EthBlockNumberOrHash) (json.RawMessage, error)
EthFeeHistory func(context.Context, ethtypes.EthUint64, string, []float64) (json.RawMessage, error)
EthGasPrice func(context.Context) (json.RawMessage, error)
EthGetBalance func(context.Context, ethtypes.EthAddress, ethtypes.EthBlockNumberOrHash) (json.RawMessage, error)
@@ -185,7 +185,7 @@ func TestEthOpenRPCConformance(t *testing.T) {
return ethapi.EthEstimateGas(context.Background(), ethtypes.EthCall{
From: &senderEthAddr,
Data: contractBin,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
},
},
@@ -451,7 +451,7 @@ func createRawSignedEthTx(ctx context.Context, t *testing.T, client *kit.TestFul
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &senderEthAddr,
Data: contractBin,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
+1 -1
View File
@@ -63,7 +63,7 @@ func TestDeployment(t *testing.T) {
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
+2 -2
View File
@@ -50,7 +50,7 @@ func TestTransactionHashLookup(t *testing.T) {
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
@@ -353,7 +353,7 @@ func TestEthGetMessageCidByTransactionHashEthTx(t *testing.T) {
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
+3 -3
View File
@@ -47,7 +47,7 @@ func TestValueTransferValidSignature(t *testing.T) {
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
@@ -235,7 +235,7 @@ func TestContractInvocation(t *testing.T) {
From: &ethAddr,
To: &contractAddr,
Data: params,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
@@ -353,7 +353,7 @@ func deployContractTx(ctx context.Context, client *kit.TestFullNode, ethAddr eth
gaslimit, err := client.EthEstimateGas(ctx, ethtypes.EthCall{
From: &ethAddr,
Data: contract,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
if err != nil {
return nil, err
}
+3 -3
View File
@@ -661,7 +661,7 @@ func TestFEVMRecursiveActorCallEstimate(t *testing.T) {
From: &ethAddr,
To: &contractAddr,
Data: params,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
require.LessOrEqual(t, int64(gaslimit), build.BlockGasLimit)
@@ -820,7 +820,7 @@ func TestFEVMBareTransferTriggersSmartContractLogic(t *testing.T) {
From: &accntEth,
To: &contractEth,
Value: ethtypes.EthBigInt(big.NewInt(100)),
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.NoError(t, err)
maxPriorityFeePerGas, err := client.EthMaxPriorityFeePerGas(ctx)
@@ -1037,7 +1037,7 @@ func TestFEVMErrorParsing(t *testing.T) {
_, err := e.EthEstimateGas(ctx, ethtypes.EthCall{
To: &contractAddrEth,
Data: entryPoint,
})
}, ethtypes.NewEthBlockNumberOrHashFromPredefined("latest"))
require.ErrorContains(t, err, expected)
})
})