eth-testing/chains/mainnet/chain_test.go
Roy Crihfield 88b1330e13
All checks were successful
Test / Run unit tests (push) Successful in 3m42s
Add post-Merge fixtures and refactor (#6)
- Add `postmerge1` chaindata
- Rename `small*` chaindata to `premerge*`
- Move chains into `chains` sub package (avoids having a non-data directory named `chaindata`)
- Add unit test Gitea workflow
- Update geth to 1.14.5

Reviewed-on: #6
2024-07-08 06:35:28 +00:00

25 lines
661 B
Go

package mainnet_test
import (
"testing"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/triedb"
"github.com/cerc-io/eth-testing/chains/mainnet"
)
func TestLoadChain(t *testing.T) {
db := rawdb.NewMemoryDatabase()
core.DefaultGenesisBlock().MustCommit(db, triedb.NewDatabase(db, nil))
blocks := mainnet.GetBlocks()
chain, _ := core.NewBlockChain(db, nil, nil, nil, ethash.NewFaker(), vm.Config{}, nil, nil)
_, err := chain.InsertChain(blocks[1:])
if err != nil {
t.Fatal(err)
}
}