Skip to content

Commit

Permalink
Fix FeeOps duplicated index issue and improve geth-sdk.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquescaocb committed Sep 28, 2023
1 parent c47b4c4 commit f545492
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions services/construction/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion services/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit f545492

Please sign in to comment.