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" tag_name: "$TRAVIS_TAG"
- os: osx - os: osx
go: 1.10.x go: 1.10.3
script: script:
- unset -f cd # workaround for https://github.com/travis-ci/travis-ci/issues/8703 - unset -f cd # workaround for https://github.com/travis-ci/travis-ci/issues/8703
- brew update - brew update

View file

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

View file

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

View file

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