Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions internal/ethapi/api.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
func MarshalReceipt(r *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex int) map[string]any {
return marshalReceipt(r, blockHash, blockNumber, signer, tx, txIndex)
}

// RevertError exports the [revertError] type.
type RevertError = revertError

// NewRevertError exports the [newRevertError] constructor.
func NewRevertError(revert []byte) *RevertError {
return newRevertError(revert)
}
20 changes: 19 additions & 1 deletion libevm/ethapi/ethapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
package ethapi

import (
"context"
"math/big"
"time"

"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/libevm/internal/ethapi"
"github.com/ava-labs/libevm/params"
"github.com/ava-labs/libevm/rpc"
)

// Type aliases required by constructors.
Expand All @@ -49,7 +53,11 @@ type (

// Type aliases for types used as arguments or responses to the APIs.
type (
RPCTransaction = ethapi.RPCTransaction
RPCTransaction = ethapi.RPCTransaction
TransactionArgs = ethapi.TransactionArgs
StateOverride = ethapi.StateOverride
BlockOverrides = ethapi.BlockOverrides
RevertError = ethapi.RevertError
)

// NewEthereumAPI is identical to [ethapi.NewEthereumAPI].
Expand Down Expand Up @@ -91,3 +99,13 @@ func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
func MarshalReceipt(r *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex int) map[string]any {
return ethapi.MarshalReceipt(r, blockHash, blockNumber, signer, tx, txIndex)
}

// DoCall is identical to [ethapi.DoCall].
func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, blockOverrides *BlockOverrides, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error) {
return ethapi.DoCall(ctx, b, args, blockNrOrHash, overrides, blockOverrides, timeout, globalGasCap)
}

// NewRevertError is identical to [ethapi.NewRevertError].
func NewRevertError(revert []byte) *RevertError {
return ethapi.NewRevertError(revert)
}