Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
tests,eth62/63: updated tests to support 62/63
Browse files Browse the repository at this point in the history
  • Loading branch information
gravity committed Aug 29, 2016
1 parent f8ca00d commit ac60455
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 1,114 deletions.
2 changes: 2 additions & 0 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ func ValidateHeader(config *ChainConfig, pow pow.PoW, header *types.Header, pare
return &BlockNonceErr{header.Number, header.Hash(), header.Nonce.Uint64()}
}
}
// TODO Iterate over Forks to validate
// If all checks passed, validate the extra-data field for hard forks
//return config.Fork("ETF").ValidateForkHeaderExtraData(header)
return nil
}

Expand Down
4 changes: 1 addition & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ func (self *BlockChain) CurrentFastBlock() *types.Block {
func (self *BlockChain) Status() (td *big.Int, currentBlock common.Hash, genesisBlock common.Hash) {
self.mu.RLock()
defer self.mu.RUnlock()

return self.GetTd(self.currentBlock.Hash()), self.currentBlock.Hash(), self.genesisBlock.Hash()
}

Expand Down Expand Up @@ -362,7 +361,6 @@ func (bc *BlockChain) Reset() {
func (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) {
// Dump the entire block chain and purge the caches
bc.SetHead(0)

bc.mu.Lock()
defer bc.mu.Unlock()

Expand Down Expand Up @@ -844,6 +842,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
}

if BadHashes[block.Hash()] {
glog.Infof("Found bad hash")
err := BadHashError(block.Hash())
reportBlock(block, err)
return i, err
Expand All @@ -865,7 +864,6 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
if block.Time().Cmp(max) == 1 {
return i, fmt.Errorf("%v: BlockFutureErr, %v > %v", BlockFutureErr, block.Time(), max)
}

self.futureBlocks.Add(block.Hash(), block)
stats.queued++
continue
Expand Down
2 changes: 1 addition & 1 deletion core/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var BadHashes = map[common.Hash]bool{
// https://blog.ethereum.org/2015/08/20/security-alert-consensus-issue
common.HexToHash("05bef30ef572270f654746da22639a7a0c97dd97a7050b9e252391996aaeb689"): true,
// ETFork #1920000 Block Hash
//common.HexToHash("4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb"): true,
common.HexToHash("4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb"): true,
}

func LoadForkHashes() {
Expand Down
2 changes: 1 addition & 1 deletion core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c *ChainConfig) IsHomestead(num *big.Int) bool {
if c.Fork("Homestead").Block == nil || num == nil {
return false
}
return num.Cmp(c.Fork("Homestead").Block) > 0
return num.Cmp(c.Fork("Homestead").Block) >= 0
}

func (c *ChainConfig) Fork(name string) *Fork {
Expand Down
Loading

0 comments on commit ac60455

Please sign in to comment.