Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
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
61 changes: 33 additions & 28 deletions core/types/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ import (
// So we list them all here to avoid having many individual files.
type (
AccessList = ethtypes.AccessList
AccessTuple = ethtypes.AccessTuple
AccessListTx = ethtypes.AccessListTx
AccessTuple = ethtypes.AccessTuple
BlobTx = ethtypes.BlobTx
BlobTxSidecar = ethtypes.BlobTxSidecar
Bloom = ethtypes.Bloom
DynamicFeeTx = ethtypes.DynamicFeeTx
HomesteadSigner = ethtypes.HomesteadSigner
LegacyTx = ethtypes.LegacyTx
Receipt = ethtypes.Receipt
Receipts = ethtypes.Receipts
ReceiptForStorage = ethtypes.ReceiptForStorage
LegacyTx = ethtypes.LegacyTx
DynamicFeeTx = ethtypes.DynamicFeeTx
BlobTx = ethtypes.BlobTx
BlobTxSidecar = ethtypes.BlobTxSidecar
Receipts = ethtypes.Receipts
Signer = ethtypes.Signer
HomesteadSigner = ethtypes.HomesteadSigner

Transaction = ethtypes.Transaction
Transactions = ethtypes.Transactions
TxByNonce = ethtypes.TxByNonce
TxData = ethtypes.TxData
SlimAccount = ethtypes.SlimAccount
StateAccount = ethtypes.StateAccount
Transaction = ethtypes.Transaction
Transactions = ethtypes.Transactions
TxByNonce = ethtypes.TxByNonce
TxData = ethtypes.TxData
)

// The following constants are used directly as their upstream definitions.
Expand All @@ -38,39 +39,43 @@ const (
ReceiptStatusSuccessful = ethtypes.ReceiptStatusSuccessful

// Transaction types.
LegacyTxType = ethtypes.LegacyTxType
AccessListTxType = ethtypes.AccessListTxType
DynamicFeeTxType = ethtypes.DynamicFeeTxType
BlobTxType = ethtypes.BlobTxType
DynamicFeeTxType = ethtypes.DynamicFeeTxType
LegacyTxType = ethtypes.LegacyTxType
)

// The following functions are used directly as their upstream definitions.
var (
BloomLookup = ethtypes.BloomLookup
BytesToBloom = ethtypes.BytesToBloom
CreateBloom = ethtypes.CreateBloom
NewReceipt = ethtypes.NewReceipt
NewContractCreation = ethtypes.NewContractCreation
NewTransaction = ethtypes.NewTransaction
BloomLookup = ethtypes.BloomLookup
BytesToBloom = ethtypes.BytesToBloom
CreateBloom = ethtypes.CreateBloom
FullAccount = ethtypes.FullAccount
FullAccountRLP = ethtypes.FullAccountRLP
NewContractCreation = ethtypes.NewContractCreation
NewEmptyStateAccount = ethtypes.NewEmptyStateAccount
NewReceipt = ethtypes.NewReceipt
NewTransaction = ethtypes.NewTransaction
SlimAccountRLP = ethtypes.SlimAccountRLP

// Signers
NewEIP155Signer = ethtypes.NewEIP155Signer
NewEIP2930Signer = ethtypes.NewEIP2930Signer
NewLondonSigner = ethtypes.NewLondonSigner
NewCancunSigner = ethtypes.NewCancunSigner
MakeSigner = ethtypes.MakeSigner
LatestSigner = ethtypes.LatestSigner
LatestSignerForChainID = ethtypes.LatestSignerForChainID
SignTx = ethtypes.SignTx
SignNewTx = ethtypes.SignNewTx
MakeSigner = ethtypes.MakeSigner
MustSignNewTx = ethtypes.MustSignNewTx
NewCancunSigner = ethtypes.NewCancunSigner
NewEIP155Signer = ethtypes.NewEIP155Signer
NewEIP2930Signer = ethtypes.NewEIP2930Signer
NewLondonSigner = ethtypes.NewLondonSigner
Sender = ethtypes.Sender
SignNewTx = ethtypes.SignNewTx
SignTx = ethtypes.SignTx

// Transactions
NewTx = ethtypes.NewTx
TxDifference = ethtypes.TxDifference

// Errors
ErrTxTypeNotSupported = ethtypes.ErrTxTypeNotSupported
ErrGasFeeCapTooLow = ethtypes.ErrGasFeeCapTooLow
ErrTxTypeNotSupported = ethtypes.ErrTxTypeNotSupported
)
14 changes: 14 additions & 0 deletions core/types/libevm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// (c) 2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package types

import (
ethtypes "github.com/ava-labs/libevm/core/types"
)

var extras = ethtypes.RegisterExtras[
ethtypes.NOOPHeaderHooks, *ethtypes.NOOPHeaderHooks,
ethtypes.NOOPBlockBodyHooks, *ethtypes.NOOPBlockBodyHooks,
isMultiCoin,
]()
25 changes: 2 additions & 23 deletions core/types/state_account.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc.
// (c) 2019-2025, Ava Labs, Inc.
//
// This file is a derived work, based on the go-ethereum library whose original
// notices appear below.
Expand Down Expand Up @@ -30,30 +30,9 @@ import (
ethtypes "github.com/ava-labs/libevm/core/types"
)

type (
// Import these types from the go-ethereum package
StateAccount = ethtypes.StateAccount
SlimAccount = ethtypes.SlimAccount
)

var (
// Import these functions from the go-ethereum package
NewEmptyStateAccount = ethtypes.NewEmptyStateAccount
SlimAccountRLP = ethtypes.SlimAccountRLP
FullAccount = ethtypes.FullAccount
FullAccountRLP = ethtypes.FullAccountRLP
)

type isMultiCoin bool

var (
extras = ethtypes.RegisterExtras[
ethtypes.NOOPHeaderHooks, *ethtypes.NOOPHeaderHooks,
ethtypes.NOOPBlockBodyHooks, *ethtypes.NOOPBlockBodyHooks,
isMultiCoin,
]()
IsMultiCoinPayloads = extras.StateAccount
)
var IsMultiCoinPayloads = extras.StateAccount

func IsMultiCoin(s ethtypes.StateOrSlimAccount) bool {
return bool(IsMultiCoinPayloads.Get(s))
Expand Down
Loading