some panics, dont panic on invalid opcode

This commit is contained in:
Ethan Buchman
2015-07-07 14:11:21 -07:00
committed by Jae Kwon
parent 415c12fca5
commit 8d6f80592b
4 changed files with 17 additions and 20 deletions
+2 -8
View File
@@ -53,10 +53,7 @@ func sha256Func(input []byte, gas *int64) (output []byte, err error) {
// Hash
hasher := sha256.New()
// CONTRACT: this does not err
_, err = hasher.Write(input)
if err != nil {
panic(err)
}
hasher.Write(input)
return hasher.Sum(nil), nil
}
@@ -71,10 +68,7 @@ func ripemd160Func(input []byte, gas *int64) (output []byte, err error) {
// Hash
hasher := ripemd160.New()
// CONTRACT: this does not err
_, err = hasher.Write(input)
if err != nil {
panic(err)
}
hasher.Write(input)
return LeftPadBytes(hasher.Sum(nil), 32), nil
}