diff --git a/services/construction/types.go b/services/construction/types.go index 17c3e96..2e4662b 100644 --- a/services/construction/types.go +++ b/services/construction/types.go @@ -22,6 +22,7 @@ import ( evmClient "github.com/coinbase/rosetta-geth-sdk/client" "github.com/coinbase/rosetta-geth-sdk/configuration" RosettaTypes "github.com/coinbase/rosetta-sdk-go/types" + Eth "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" EthTypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" @@ -181,4 +182,10 @@ type Client interface { ParseOps( tx *evmClient.LoadedTransaction, ) ([]*RosettaTypes.Operation, error) + + // EstimateGas tries to estimate the gas needed to execute a specific transaction based on + // the current pending state of the backend blockchain. There is no guarantee that this is + // the true gas limit requirement as other transactions may be added or removed by miners, + // but it should provide a basis for setting a reasonable default. + EstimateGas(ctx context.Context, msg Eth.CallMsg) (uint64, error) } diff --git a/services/mapper.go b/services/mapper.go index ede8e9f..2997d1b 100644 --- a/services/mapper.go +++ b/services/mapper.go @@ -184,7 +184,7 @@ func FeeOps(tx *evmClient.LoadedTransaction) []*RosettaTypes.Operation { burntOp := &RosettaTypes.Operation{ OperationIdentifier: &RosettaTypes.OperationIdentifier{ - Index: 0, // nolint:gomnd + Index: 2, // nolint:gomnd }, Type: sdkTypes.FeeOpType, Status: RosettaTypes.String(sdkTypes.SuccessStatus),