Compare commits

..

No commits in common. "fc17f64d9f93f227675f5225509f4baf3ffa37f1" and "cd5ea103dc041805a4cd83198673b36b0434a199" have entirely different histories.

45 changed files with 8 additions and 10 deletions

View File

@ -17,12 +17,10 @@ import (
const LatestBlock uint = 3
var blocks []*types.Block
// LoadBlocks loads fixture blocks up to and including the passed height or the highest available block
func GetBlocks() []*types.Block {
if blocks != nil {
return blocks
func LoadBlocks(upto uint) []*types.Block {
if upto > LatestBlock {
upto = LatestBlock
}
db := rawdb.NewMemoryDatabase()
genesisBlock := core.DefaultGenesisBlock().MustCommit(db)
@ -38,11 +36,11 @@ func GetBlocks() []*types.Block {
panic("mainnet genesis blocks do not match")
}
blocks := make([]*types.Block, LatestBlock+1)
blocks := make([]*types.Block, upto+1)
blocks[0] = new(types.Block)
rlp.DecodeBytes(block0RLP, blocks[0])
for i := uint(1); i <= LatestBlock; i++ {
for i := uint(1); i <= upto; i++ {
blockRLP, err := loadBlockRLP(fmt.Sprintf("./block%d_rlp", i))
if err != nil {
panic(err)

View File

@ -1,7 +1,7 @@
package medium
import (
"github.com/cerc-io/eth-testing/chaindata/util"
"github.com/cerc-io/eth-test-data/fixture/util"
)
var (

View File

@ -1,7 +1,7 @@
package small
import (
"github.com/cerc-io/eth-testing/chaindata/util"
"github.com/cerc-io/eth-test-data/fixture/util"
)
var (

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/cerc-io/eth-testing
module github.com/cerc-io/eth-test-data
go 1.19