Fix new types for blocktests and comment out non-working log level setter

pull/537/head
Gustav Simonsson 10 years ago
parent 60de4d6dd1
commit 5d31a475e9
  1. 2
      cmd/ethtest/main.go
  2. 8
      tests/blocktest.go

@ -219,7 +219,7 @@ func RunVmTest(r io.Reader) (failed int) {
} }
func main() { func main() {
helper.Logger.SetLogLevel(5) //helper.Logger.SetLogLevel(5)
vm.Debug = true vm.Debug = true
if len(os.Args) > 1 { if len(os.Args) > 1 {

@ -119,7 +119,7 @@ func (t *BlockTest) InsertPreState(db common.Database) (*state.StateDB, error) {
// sync trie to disk // sync trie to disk
statedb.Sync() statedb.Sync()
if !bytes.Equal(t.Genesis.Root(), statedb.Root()) { if !bytes.Equal(t.Genesis.Root().Bytes(), statedb.Root().Bytes()) {
return nil, errors.New("computed state root does not match genesis block") return nil, errors.New("computed state root does not match genesis block")
} }
return statedb, nil return statedb, nil
@ -134,9 +134,9 @@ func (t *BlockTest) ValidatePostState(statedb *state.StateDB) error {
nonce, _ := strconv.ParseUint(acct.Nonce, 16, 64) nonce, _ := strconv.ParseUint(acct.Nonce, 16, 64)
// address is indirectly verified by the other fields, as it's the db key // address is indirectly verified by the other fields, as it's the db key
code2 := statedb.GetCode(addr) code2 := statedb.GetCode(common.BytesToAddress(addr))
balance2 := statedb.GetBalance(addr) balance2 := statedb.GetBalance(common.BytesToAddress(addr))
nonce2 := statedb.GetNonce(addr) nonce2 := statedb.GetNonce(common.BytesToAddress(addr))
if !bytes.Equal(code2, code) { if !bytes.Equal(code2, code) {
return fmt.Errorf("account code mismatch, addr, found, expected: ", addrString, hex.EncodeToString(code2), hex.EncodeToString(code)) return fmt.Errorf("account code mismatch, addr, found, expected: ", addrString, hex.EncodeToString(code2), hex.EncodeToString(code))
} }

Loading…
Cancel
Save