Skip to content

Commit

Permalink
rename NewBlockChainArbitrum to NewArbBlockChain
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Feb 26, 2024
1 parent 1ac9c79 commit de45e56
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions arbitrum/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestSimpleSync(t *testing.T) {
testUser2Address: {Balance: new(big.Int).Lsh(big.NewInt(1), 250)},
},
}
sourceChain, _ := core.NewBlockChainArbitrum(sourceDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
sourceChain, _ := core.NewArbBlockChain(sourceDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
signer := types.MakeSigner(sourceChain.Config(), big.NewInt(1), 0)

firstAddress := common.Address{}
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestSimpleSync(t *testing.T) {
if err != nil {
t.Fatal(err)
}
badChain, _ := core.NewBlockChainArbitrum(badDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
badChain, _ := core.NewArbBlockChain(badDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
if _, err := badChain.InsertChain(badBlocks[:pivotBlockNum]); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -344,7 +344,7 @@ func TestSimpleSync(t *testing.T) {
if err != nil {
t.Fatal(err)
}
destChain, _ := core.NewBlockChainArbitrum(destDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
destChain, _ := core.NewArbBlockChain(destDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, nil, nil)
destHandler := NewProtocolHandler(destDb, destChain, &dummySyncHelper{syncBlock.Header(), nil}, true)
destStack.RegisterProtocols(destHandler.MakeProtocols(iter))

Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ type trieGcEntry struct {
GasUsed uint64
}

func NewBlockChainArbitrum(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, shouldPreserve func(header *types.Header) bool, txLookupLimit *uint64, forceTriedbCommitHook ForceTriedbCommitHook) (*BlockChain, error) {
func NewArbBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, shouldPreserve func(header *types.Header) bool, txLookupLimit *uint64, forceTriedbCommitHook ForceTriedbCommitHook) (*BlockChain, error) {
bc, err := NewBlockChain(db, cacheConfig, chainConfig, genesis, overrides, engine, vmConfig, shouldPreserve)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,7 @@ func TestTransactionIndices(t *testing.T) {
rawdb.WriteAncientBlocks(ancientDb, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), big.NewInt(0))

l := l
chain, err := NewBlockChainArbitrum(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
chain, err := NewArbBlockChain(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
if err != nil {
t.Fatalf("failed to create tester chain: %v", err)
}
Expand All @@ -2609,7 +2609,7 @@ func TestTransactionIndices(t *testing.T) {
limit = []uint64{0, 64 /* drop stale */, 32 /* shorten history */, 64 /* extend history */, 0 /* restore all */}
for _, l := range limit {
l := l
chain, err := NewBlockChainArbitrum(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
chain, err := NewArbBlockChain(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
if err != nil {
t.Fatalf("failed to create tester chain: %v", err)
}
Expand Down Expand Up @@ -2682,7 +2682,7 @@ func TestSkipStaleTxIndicesInSnapSync(t *testing.T) {

// Import all blocks into ancient db, only HEAD-32 indices are kept.
l := uint64(32)
chain, err := NewBlockChainArbitrum(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
chain, err := NewArbBlockChain(ancientDb, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
if err != nil {
t.Fatalf("failed to create tester chain: %v", err)
}
Expand Down Expand Up @@ -4021,7 +4021,7 @@ func TestTxIndexer(t *testing.T) {
rawdb.WriteAncientBlocks(db, append([]*types.Block{gspec.ToBlock()}, blocks...), append([]types.Receipts{{}}, receipts...), big.NewInt(0))

// Index the initial blocks from ancient store
chain, _ := NewBlockChainArbitrum(db, nil, nil, gspec, nil, engine, vm.Config{}, nil, &c.limitA, nil)
chain, _ := NewArbBlockChain(db, nil, nil, gspec, nil, engine, vm.Config{}, nil, &c.limitA, nil)
chain.indexBlocks(nil, 128, make(chan struct{}))
verify(db, c.tailA)

Expand Down
2 changes: 1 addition & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.OverrideVerkle != nil {
overrides.OverrideVerkle = config.OverrideVerkle
}
eth.blockchain, err = core.NewBlockChainArbitrum(chainDb, cacheConfig, nil, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit, nil)
eth.blockchain, err = core.NewArbBlockChain(chainDb, cacheConfig, nil, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit, nil)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion eth/filters/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func TestFilters(t *testing.T) {
}
})
var l uint64
bc, err := core.NewBlockChainArbitrum(db, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
bc, err := core.NewArbBlockChain(db, nil, nil, gspec, nil, ethash.NewFaker(), vm.Config{}, nil, &l, nil)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func newTestBackend(t *testing.T, n int, gspec *core.Genesis, generator func(i i
// Generate blocks for testing
db, blocks, _ := core.GenerateChainWithGenesis(gspec, engine, n, generator)
txlookupLimit := uint64(0)
chain, err := core.NewBlockChainArbitrum(db, cacheConfig, nil, gspec, nil, engine, vm.Config{}, nil, &txlookupLimit, nil)
chain, err := core.NewArbBlockChain(db, cacheConfig, nil, gspec, nil, engine, vm.Config{}, nil, &txlookupLimit, nil)
if err != nil {
t.Fatalf("failed to create tester chain: %v", err)
}
Expand Down

0 comments on commit de45e56

Please sign in to comment.