Fix test cases for Callisto

+ Please revert this commit for multi-geth implementation (temporary fix for go-callisto)
This commit is contained in:
Akira Takizawa 2018-08-29 09:25:37 +09:00
parent 3ae32aaed8
commit 5ded17cef0
No known key found for this signature in database
GPG key ID: 4BB42E31C79111B8
4 changed files with 17 additions and 17 deletions

View file

@ -30,7 +30,7 @@ matrix:
tag_name: "$TRAVIS_TAG"
- os: osx
go: 1.10.x
go: 1.10.3
script:
- unset -f cd # workaround for https://github.com/travis-ci/travis-ci/issues/8703
- brew update

View file

@ -89,7 +89,7 @@ func TestDAOForkBlockNewChain(t *testing.T) {
expectVote bool
}{
// Test DAO Default Mainnet
{"", params.MainnetChainConfig.DAOForkBlock, true},
{"", params.CallistoChainConfig.DAOForkBlock, false},
// test DAO Init Old Privnet
{daoOldGenesis, nil, false},
// test DAO Default No Fork Privnet
@ -127,7 +127,7 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc
}
defer db.Close()
genesisHash := common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")
genesisHash := common.HexToHash("0x82270b80fc90beb005505a9ef95039639968a0e81b2904ad30128c93d713d2c4")
if genesis != "" {
genesisHash = daoGenesisHash
}

View file

@ -36,13 +36,13 @@ var customGenesisTests = []struct {
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000042",
"nonce" : "0x0000000000000000",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00"
}`,
query: "eth.getBlock(0).nonce",
result: "0x0000000000000042",
result: "0x0000000000000000",
},
// Genesis file with an empty chain configuration (ensure missing fields work)
{
@ -52,14 +52,14 @@ var customGenesisTests = []struct {
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000042",
"nonce" : "0x0000000000000000",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00",
"config" : {}
}`,
query: "eth.getBlock(0).nonce",
result: "0x0000000000000042",
result: "0x0000000000000000",
},
// Genesis file with specific chain configurations
{
@ -69,7 +69,7 @@ var customGenesisTests = []struct {
"difficulty" : "0x20000",
"extraData" : "",
"gasLimit" : "0x2fefd8",
"nonce" : "0x0000000000000042",
"nonce" : "0x0000000000000000",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00",
@ -80,7 +80,7 @@ var customGenesisTests = []struct {
}
}`,
query: "eth.getBlock(0).nonce",
result: "0x0000000000000042",
result: "0x0000000000000000",
},
}

View file

@ -31,9 +31,9 @@ import (
)
func TestDefaultGenesisBlock(t *testing.T) {
block := DefaultGenesisBlock().ToBlock(nil)
if block.Hash() != params.MainnetGenesisHash {
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash)
block := DefaultCallistoGenesisBlock().ToBlock(nil)
if block.Hash() != params.CallistoGenesisHash {
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.CallistoGenesisHash)
}
block = DefaultTestnetGenesisBlock().ToBlock(nil)
if block.Hash() != params.TestnetGenesisHash {
@ -73,17 +73,17 @@ func TestSetupGenesis(t *testing.T) {
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
return SetupGenesisBlock(db, nil)
},
wantHash: params.MainnetGenesisHash,
wantConfig: params.MainnetChainConfig,
wantHash: params.CallistoGenesisHash,
wantConfig: params.CallistoChainConfig,
},
{
name: "mainnet block in DB, genesis == nil",
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
DefaultGenesisBlock().MustCommit(db)
DefaultCallistoGenesisBlock().MustCommit(db)
return SetupGenesisBlock(db, nil)
},
wantHash: params.MainnetGenesisHash,
wantConfig: params.MainnetChainConfig,
wantHash: params.CallistoGenesisHash,
wantConfig: params.CallistoChainConfig,
},
{
name: "custom block in DB, genesis == nil",