From 52f137c850d5099c542fe2dfcfd0b016ff2a9391 Mon Sep 17 00:00:00 2001 From: Tomoaki Tsuzuki Date: Tue, 5 Jun 2018 05:02:09 +0900 Subject: [PATCH] Feature/fix_some_tests (#387) * same fix as ethereum/go-ethereum#15783 * Fix insufficient balance for transfer * change chainId of QuorumTestChainConfig --- cmd/geth/misccmd.go | 3 +-- core/blockchain_test.go | 4 ++-- params/config.go | 4 ++-- whisper/whisperv2/whisper.go | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index 63c02438f..a98c9f079 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -134,7 +134,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with geth. If not, see . -`) +along with geth. If not, see .`) return nil } diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 33cbd1e35..902070959 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -1037,7 +1037,7 @@ func TestEIP155Transition(t *testing.T) { funds = big.NewInt(1000000000) deleteAddr = common.Address{1} gspec = &Genesis{ - Config: ¶ms.ChainConfig{ChainId: big.NewInt(1), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}, + Config: ¶ms.ChainConfig{ChainId: big.NewInt(10), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}, Alloc: GenesisAlloc{address: {Balance: funds}, deleteAddr: {Balance: new(big.Int)}}, } genesis = gspec.MustCommit(db) @@ -1142,7 +1142,7 @@ func TestEIP161AccountRemoval(t *testing.T) { theAddr = common.Address{1} gspec = &Genesis{ Config: ¶ms.ChainConfig{ - ChainId: big.NewInt(1), + ChainId: big.NewInt(10), HomesteadBlock: new(big.Int), EIP155Block: new(big.Int), EIP158Block: big.NewInt(2), diff --git a/params/config.go b/params/config.go index 4983870d9..9af86d89f 100644 --- a/params/config.go +++ b/params/config.go @@ -110,10 +110,10 @@ var ( // adding flags to the config to also have to set these fields. AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, false} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil, false} + TestChainConfig = &ChainConfig{big.NewInt(10), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil, false} TestRules = TestChainConfig.Rules(new(big.Int)) - QuorumTestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, nil, common.Hash{}, nil, nil, nil, new(EthashConfig), nil, nil, true} + QuorumTestChainConfig = &ChainConfig{big.NewInt(10), big.NewInt(0), nil, false, nil, common.Hash{}, nil, nil, nil, new(EthashConfig), nil, nil, true} ) // ChainConfig is the core config which determines the blockchain settings. diff --git a/whisper/whisperv2/whisper.go b/whisper/whisperv2/whisper.go index 61c36918d..e111a3414 100644 --- a/whisper/whisperv2/whisper.go +++ b/whisper/whisperv2/whisper.go @@ -262,7 +262,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Insert the message into the tracked pool hash := envelope.Hash() if _, ok := self.messages[hash]; ok { - log.Trace(fmt.Sprintf("whisper envelope already cached: %x\n", envelope)) + log.Trace(fmt.Sprintf("whisper envelope already cached: %x\n", hash)) return nil } self.messages[hash] = envelope @@ -277,7 +277,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Notify the local node of a message arrival go self.postEvent(envelope) } - log.Trace(fmt.Sprintf("cached whisper envelope %x\n", envelope)) + log.Trace(fmt.Sprintf("cached whisper envelope %x\n", hash)) return nil }