Skip to content

Commit bfcc2f6

Browse files
author
Darioush Jalali
committed
libevm renaming nits (#683)
1 parent bbd95fa commit bfcc2f6

File tree

14 files changed

+77
-77
lines changed

14 files changed

+77
-77
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-20.04
1818
steps:
1919
- uses: actions/checkout@v4
20-
- run: ./scripts/lint_allowed_geth_imports.sh
20+
- run: ./scripts/lint_allowed_eth_imports.sh
2121
shell: bash
2222
- uses: actions/setup-go@v5
2323
with:

core/evm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"github.com/ava-labs/coreth/params"
3838
"github.com/ava-labs/coreth/predicate"
3939
"github.com/ava-labs/libevm/common"
40-
gethtypes "github.com/ava-labs/libevm/core/types"
40+
ethtypes "github.com/ava-labs/libevm/core/types"
4141
"github.com/ava-labs/libevm/core/vm"
4242
"github.com/ava-labs/libevm/log"
4343
"github.com/holiman/uint256"
@@ -152,7 +152,7 @@ func newEVMBlockContext(header *types.Header, chain ChainContext, author *common
152152
BaseFee: baseFee,
153153
BlobBaseFee: blobBaseFee,
154154
GasLimit: header.GasLimit,
155-
Header: &gethtypes.Header{
155+
Header: &ethtypes.Header{
156156
Number: new(big.Int).Set(header.Number),
157157
Time: header.Time,
158158
Extra: extra,

core/types/block.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (n *BlockNonce) UnmarshalText(input []byte) error {
6767
}
6868

6969
//go:generate go run github.com/fjl/gencodec -type Header -field-override headerMarshaling -out gen_header_json.go
70-
//go:generate go run github.com/ethereum/go-ethereum/rlp/rlpgen -type Header -out gen_header_rlp.go
70+
//go:generate go run github.com/ava-labs/libevm/rlp/rlpgen -type Header -out gen_header_rlp.go
7171

7272
// Header represents a block header in the Ethereum blockchain.
7373
type Header struct {

core/types/imports.go

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,74 @@
44
package types
55

66
import (
7-
gethtypes "github.com/ava-labs/libevm/core/types"
7+
ethtypes "github.com/ava-labs/libevm/core/types"
88
)
99

1010
// The following types are used directly as their upstream definitions.
1111
// So we list them all here to avoid having many individual files.
1212
type (
13-
AccessList = gethtypes.AccessList
14-
AccessTuple = gethtypes.AccessTuple
15-
AccessListTx = gethtypes.AccessListTx
16-
Bloom = gethtypes.Bloom
17-
Receipt = gethtypes.Receipt
18-
Receipts = gethtypes.Receipts
19-
ReceiptForStorage = gethtypes.ReceiptForStorage
20-
LegacyTx = gethtypes.LegacyTx
21-
DynamicFeeTx = gethtypes.DynamicFeeTx
22-
BlobTx = gethtypes.BlobTx
23-
BlobTxSidecar = gethtypes.BlobTxSidecar
24-
Signer = gethtypes.Signer
25-
HomesteadSigner = gethtypes.HomesteadSigner
26-
FrontierSigner = gethtypes.FrontierSigner
13+
AccessList = ethtypes.AccessList
14+
AccessTuple = ethtypes.AccessTuple
15+
AccessListTx = ethtypes.AccessListTx
16+
Bloom = ethtypes.Bloom
17+
Receipt = ethtypes.Receipt
18+
Receipts = ethtypes.Receipts
19+
ReceiptForStorage = ethtypes.ReceiptForStorage
20+
LegacyTx = ethtypes.LegacyTx
21+
DynamicFeeTx = ethtypes.DynamicFeeTx
22+
BlobTx = ethtypes.BlobTx
23+
BlobTxSidecar = ethtypes.BlobTxSidecar
24+
Signer = ethtypes.Signer
25+
HomesteadSigner = ethtypes.HomesteadSigner
26+
FrontierSigner = ethtypes.FrontierSigner
2727

28-
Transaction = gethtypes.Transaction
29-
Transactions = gethtypes.Transactions
30-
TxByNonce = gethtypes.TxByNonce
31-
TxData = gethtypes.TxData
28+
Transaction = ethtypes.Transaction
29+
Transactions = ethtypes.Transactions
30+
TxByNonce = ethtypes.TxByNonce
31+
TxData = ethtypes.TxData
3232
)
3333

3434
// The following constants are used directly as their upstream definitions.
3535
const (
36-
BloomBitLength = gethtypes.BloomBitLength
37-
BloomByteLength = gethtypes.BloomByteLength
38-
ReceiptStatusFailed = gethtypes.ReceiptStatusFailed
39-
ReceiptStatusSuccessful = gethtypes.ReceiptStatusSuccessful
36+
BloomBitLength = ethtypes.BloomBitLength
37+
BloomByteLength = ethtypes.BloomByteLength
38+
ReceiptStatusFailed = ethtypes.ReceiptStatusFailed
39+
ReceiptStatusSuccessful = ethtypes.ReceiptStatusSuccessful
4040

4141
// Transaction types.
42-
LegacyTxType = gethtypes.LegacyTxType
43-
AccessListTxType = gethtypes.AccessListTxType
44-
DynamicFeeTxType = gethtypes.DynamicFeeTxType
45-
BlobTxType = gethtypes.BlobTxType
42+
LegacyTxType = ethtypes.LegacyTxType
43+
AccessListTxType = ethtypes.AccessListTxType
44+
DynamicFeeTxType = ethtypes.DynamicFeeTxType
45+
BlobTxType = ethtypes.BlobTxType
4646
)
4747

4848
// The following functions are used directly as their upstream definitions.
4949
var (
50-
BloomLookup = gethtypes.BloomLookup
51-
BytesToBloom = gethtypes.BytesToBloom
52-
CreateBloom = gethtypes.CreateBloom
53-
NewReceipt = gethtypes.NewReceipt
54-
NewContractCreation = gethtypes.NewContractCreation
55-
NewTransaction = gethtypes.NewTransaction
50+
BloomLookup = ethtypes.BloomLookup
51+
BytesToBloom = ethtypes.BytesToBloom
52+
CreateBloom = ethtypes.CreateBloom
53+
NewReceipt = ethtypes.NewReceipt
54+
NewContractCreation = ethtypes.NewContractCreation
55+
NewTransaction = ethtypes.NewTransaction
5656

5757
// Signers
58-
NewEIP155Signer = gethtypes.NewEIP155Signer
59-
NewEIP2930Signer = gethtypes.NewEIP2930Signer
60-
NewLondonSigner = gethtypes.NewLondonSigner
61-
NewCancunSigner = gethtypes.NewCancunSigner
62-
MakeSigner = gethtypes.MakeSigner
63-
LatestSigner = gethtypes.LatestSigner
64-
LatestSignerForChainID = gethtypes.LatestSignerForChainID
65-
SignTx = gethtypes.SignTx
66-
SignNewTx = gethtypes.SignNewTx
67-
MustSignNewTx = gethtypes.MustSignNewTx
68-
Sender = gethtypes.Sender
58+
NewEIP155Signer = ethtypes.NewEIP155Signer
59+
NewEIP2930Signer = ethtypes.NewEIP2930Signer
60+
NewLondonSigner = ethtypes.NewLondonSigner
61+
NewCancunSigner = ethtypes.NewCancunSigner
62+
MakeSigner = ethtypes.MakeSigner
63+
LatestSigner = ethtypes.LatestSigner
64+
LatestSignerForChainID = ethtypes.LatestSignerForChainID
65+
SignTx = ethtypes.SignTx
66+
SignNewTx = ethtypes.SignNewTx
67+
MustSignNewTx = ethtypes.MustSignNewTx
68+
Sender = ethtypes.Sender
6969

7070
// Transactions
71-
NewTx = gethtypes.NewTx
72-
TxDifference = gethtypes.TxDifference
71+
NewTx = ethtypes.NewTx
72+
TxDifference = ethtypes.TxDifference
7373

7474
// Errors
75-
ErrTxTypeNotSupported = gethtypes.ErrTxTypeNotSupported
76-
ErrGasFeeCapTooLow = gethtypes.ErrGasFeeCapTooLow
75+
ErrTxTypeNotSupported = ethtypes.ErrTxTypeNotSupported
76+
ErrGasFeeCapTooLow = ethtypes.ErrGasFeeCapTooLow
7777
)

core/types/log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
package types
2828

29-
import gethtypes "github.com/ava-labs/libevm/core/types"
29+
import ethtypes "github.com/ava-labs/libevm/core/types"
3030

3131
// Log represents a contract log event. These events are generated by the LOG opcode and
3232
// stored/indexed by the node.
33-
type Log = gethtypes.Log
33+
type Log = ethtypes.Log
3434

3535
// FlattenLogs converts a nested array of logs to a single array of logs.
3636
func FlattenLogs(list [][]*Log) []*Log {

core/types/state_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/holiman/uint256"
3535
)
3636

37-
//go:generate go run github.com/ethereum/go-ethereum/rlp/rlpgen -type StateAccount -out gen_account_rlp.go
37+
//go:generate go run github.com/ava-labs/libevm/rlp/rlpgen -type StateAccount -out gen_account_rlp.go
3838

3939
// StateAccount is the Ethereum consensus representation of accounts.
4040
// These objects are stored in the main account trie.

eth/tracers/tracers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ import (
2222
"fmt"
2323

2424
"github.com/ava-labs/libevm/core/vm"
25-
gethtracers "github.com/ava-labs/libevm/eth/tracers"
25+
ethtracers "github.com/ava-labs/libevm/eth/tracers"
2626
)
2727

2828
// Context contains some contextual infos for a transaction execution that is not
2929
// available from within the EVM object.
30-
type Context = gethtracers.Context
30+
type Context = ethtracers.Context
3131

3232
// Tracer interface extends vm.EVMLogger and additionally
3333
// allows collecting the tracing result.
34-
type Tracer = gethtracers.Tracer
34+
type Tracer = ethtracers.Tracer
3535

3636
// DefaultDirectory is the collection of tracers bundled by default.
37-
var DefaultDirectory = gethtracers.DefaultDirectory
37+
var DefaultDirectory = ethtracers.DefaultDirectory
3838

3939
const (
4040
memoryPadLimit = 1024 * 1024

params/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/ava-labs/avalanchego/upgrade"
3333
"github.com/ava-labs/avalanchego/utils/constants"
3434
"github.com/ava-labs/coreth/utils"
35-
gethparams "github.com/ava-labs/libevm/params"
35+
ethparams "github.com/ava-labs/libevm/params"
3636
)
3737

3838
// Guarantees extras initialisation before a call to [ChainConfig.Rules].
@@ -216,11 +216,11 @@ var (
216216
// ChainConfig is stored in the database on a per block basis. This means
217217
// that any network, identified by its genesis block, can have its own
218218
// set of configuration options.
219-
type ChainConfig = gethparams.ChainConfig
219+
type ChainConfig = ethparams.ChainConfig
220220

221221
// Rules wraps ChainConfig and is merely syntactic sugar or can be used for functions
222222
// that do not have or require information about the block.
223223
//
224224
// Rules is a one time interface meaning that it shouldn't be used in between transition
225225
// phases.
226-
type Rules = gethparams.Rules
226+
type Rules = ethparams.Rules

params/config_extra.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/ava-labs/coreth/predicate"
1515
"github.com/ava-labs/coreth/utils"
1616
"github.com/ava-labs/libevm/common"
17-
gethparams "github.com/ava-labs/libevm/params"
17+
ethparams "github.com/ava-labs/libevm/params"
1818
)
1919

2020
const (
@@ -265,7 +265,7 @@ func configTimestampEqual(x, y *uint64) bool {
265265

266266
// ConfigCompatError is raised if the locally-stored blockchain is initialised with a
267267
// ChainConfig that would alter the past.
268-
type ConfigCompatError = gethparams.ConfigCompatError
268+
type ConfigCompatError = ethparams.ConfigCompatError
269269

270270
func newTimestampCompatError(what string, storedtime, newtime *uint64) *ConfigCompatError {
271271
var rew *uint64

params/config_libevm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ import (
99
"github.com/ava-labs/coreth/precompile/modules"
1010
"github.com/ava-labs/coreth/precompile/precompileconfig"
1111
"github.com/ava-labs/libevm/common"
12-
gethparams "github.com/ava-labs/libevm/params"
12+
ethparams "github.com/ava-labs/libevm/params"
1313
)
1414

1515
// libevmInit would ideally be a regular init() function, but it MUST be run
1616
// before any calls to [ChainConfig.Rules]. See `config.go` for its call site.
1717
func libevmInit() any {
18-
extras = gethparams.RegisterExtras(gethparams.Extras[*ChainConfigExtra, RulesExtra]{
18+
extras = ethparams.RegisterExtras(ethparams.Extras[*ChainConfigExtra, RulesExtra]{
1919
ReuseJSONRoot: true, // Reuse the root JSON input when unmarshalling the extra payload.
2020
NewRules: constructRulesExtra,
2121
})
2222
return nil
2323
}
2424

25-
var extras gethparams.ExtraPayloads[*ChainConfigExtra, RulesExtra]
25+
var extras ethparams.ExtraPayloads[*ChainConfigExtra, RulesExtra]
2626

2727
// constructRulesExtra acts as an adjunct to the [params.ChainConfig.Rules]
2828
// method. Its primary purpose is to construct the extra payload for the
2929
// [params.Rules] but it MAY also modify the [params.Rules].
30-
func constructRulesExtra(c *gethparams.ChainConfig, r *gethparams.Rules, cEx *ChainConfigExtra, blockNum *big.Int, isMerge bool, timestamp uint64) RulesExtra {
30+
func constructRulesExtra(c *ethparams.ChainConfig, r *ethparams.Rules, cEx *ChainConfigExtra, blockNum *big.Int, isMerge bool, timestamp uint64) RulesExtra {
3131
var rules RulesExtra
3232
if cEx == nil {
3333
return rules

0 commit comments

Comments
 (0)