Failing tests (#179)

* rpc: remove raft from default IPC API list

* core: fix timeout in TestReorgLongBlocks
This commit is contained in:
bas-vk 2017-09-13 22:53:54 +02:00 committed by Patrick Mylund Nielsen
parent 663710f413
commit 7af924507b
3 changed files with 11 additions and 79 deletions

View File

@ -469,16 +469,16 @@ func makeBlockChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.B
return chain
}
func chm(genesis *types.Block, db ethdb.Database) *BlockChain {
func chm(genesis *types.Block, db ethdb.Database, t *testing.T) *BlockChain {
var eventMux event.TypeMux
bc := &BlockChain{
chainDb: db,
genesisBlock: genesis,
eventMux: &eventMux,
pow: FakePow{},
config: testChainConfig(),
bc, err := NewBlockChain(db, testChainConfig(), FakePow{}, &eventMux, true)
if err != nil {
t.Fatalf("Could not create block chain: %v", err)
}
valFn := func() HeaderValidator { return bc.Validator() }
bc.genesisBlock = genesis
bc.hc, _ = NewHeaderChain(db, testChainConfig(), valFn, bc.getProcInterrupt)
bc.bodyCache, _ = lru.New(100)
bc.bodyRLPCache, _ = lru.New(100)
@ -513,7 +513,7 @@ func testReorg(t *testing.T, first, second []int, td int64, full bool) {
// Create a pristine block chain
db, _ := ethdb.NewMemDatabase()
genesis, _ := WriteTestNetGenesisBlock(db)
bc := chm(genesis, db)
bc := chm(genesis, db, t)
// Insert an easy and a difficult chain afterwards
if full {
@ -560,7 +560,7 @@ func testBadHashes(t *testing.T, full bool) {
// Create a pristine block chain
db, _ := ethdb.NewMemDatabase()
genesis, _ := WriteTestNetGenesisBlock(db)
bc := chm(genesis, db)
bc := chm(genesis, db, t)
// Create a chain, ban a hash and try to import
var err error
@ -587,7 +587,7 @@ func testReorgBadHashes(t *testing.T, full bool) {
// Create a pristine block chain
db, _ := ethdb.NewMemDatabase()
genesis, _ := WriteTestNetGenesisBlock(db)
bc := chm(genesis, db)
bc := chm(genesis, db, t)
// Create a chain, import and ban afterwards
headers := makeHeaderChainWithDiff(genesis, []int{1, 2, 3, 4}, 10)

View File

@ -1,68 +0,0 @@
package quorum_test
import (
"fmt"
"testing"
"github.com/ethereum/go-ethereum/core/quorum"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
)
var (
voteKey1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
addrVoteKey1 = crypto.PubkeyToAddress(voteKey1.PublicKey)
voteKey2, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
addrVoteKey2 = crypto.PubkeyToAddress(voteKey2.PublicKey)
blockMakerKey1, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee")
addrBlockMaker1 = crypto.PubkeyToAddress(blockMakerKey1.PublicKey)
)
func genesisBlock(voteThreshold int) string {
return fmt.Sprintf(`{
"coinbase": "0x0000000000000000000000000000000000000000",
"config": {
"homesteadBlock": 0
},
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x2FEFD800",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"nonce": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x00",
"alloc": {
"%s": {
"balance":"100000000000000000"
},
"%s": {
"balance":"100000000000000000"
},
"%s": {
"balance":"100000000000000000"
},
"%s": {
"code": "%s",
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000001": "%#x",
"0x0000000000000000000000000000000000000000000000000000000000000002": "0x02",
"0x9ba0793ab2c61c9fc0f4204891503530bba7c28e9bf7671b90e9f5010eb132c5": "0x01",
"0x706439b5bc31f518c47b3ca07b45a1b4b7ff29deae44d5f3450e5c76b207c890": "0x01",
"0x0000000000000000000000000000000000000000000000000000000000000004": "0x01",
"0xc02baebfa4f2f2bec2e73904266d093f2a0b2c1b54617f55347d7c4e6ef48047": "0x01"
}
}
}
}`,
addrVoteKey1.Hex(),
addrVoteKey2.Hex(),
addrBlockMaker1.Hex(),
params.QuorumVotingContractAddr.Hex(),
quorum.RuntimeCode,
voteThreshold,
)
}

View File

@ -32,7 +32,7 @@ const (
notificationBufferSize = 10000 // max buffered notifications before codec is closed
MetadataApi = "rpc"
DefaultIPCApis = "admin,debug,eth,net,personal,quorum,raft,shh,txpool,web3"
DefaultIPCApis = "admin,debug,eth,net,personal,quorum,shh,txpool,web3"
DefaultHTTPApis = "eth,net,web3"
)