panic wrapper functions

This commit is contained in:
Ethan Buchman
2015-07-21 10:46:05 -04:00
parent 5983088a32
commit 8e50bf15de
45 changed files with 229 additions and 275 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ func setGlobalPerm(appState AppState, acc *Account, args []byte) (output []byte,
permNum, perm := returnTwoArgs(args)
vmAcc := appState.GetAccount(ptypes.GlobalPermissionsAddress256)
if vmAcc == nil {
panic("cant find the global permissions account")
PanicSanity("cant find the global permissions account")
}
permN := ptypes.PermFlag(Uint64FromWord256(permNum))
if !ValidPermN(permN) {
+1 -1
View File
@@ -50,7 +50,7 @@ func (st *Stack) Push(d Word256) {
// currently only called after Sha3
func (st *Stack) PushBytes(bz []byte) {
if len(bz) != 32 {
panic("Invalid bytes size: expected 32")
PanicSanity("Invalid bytes size: expected 32")
}
st.Push(LeftPadWord256(bz))
}
+1 -1
View File
@@ -141,7 +141,7 @@ func (vm *VM) Call(caller, callee *Account, code, input []byte, value int64, gas
err := transfer(callee, caller, value)
if err != nil {
// data has been corrupted in ram
panic("Could not return value to caller")
PanicCrisis("Could not return value to caller")
}
}
}