bond perm and tests

This commit is contained in:
Ethan Buchman
2015-05-20 19:20:06 -04:00
committed by Jae Kwon
parent 8cdb0b91e6
commit 2ec3d0611f
6 changed files with 304 additions and 182 deletions

View File

@ -700,7 +700,7 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
dbg.Printf(" => %v\n", log)
case CREATE: // 0xF0
if vm.perms && !vm.HasPermission(callee, ptypes.Create) {
if vm.perms && !vm.HasPermission(callee, ptypes.CreateContract) {
return nil, ErrPermission{"create"}
}
contractValue := stack.Pop64()
@ -760,7 +760,7 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
} else if snativeContract := vm.snativeContracts[addr]; vm.doug && snativeContract != nil {
// This is Doug and we're calling a snative contract
// TODO: Doug contract should have all permissions
ret, err = snativeContract(args)
ret, err = snativeContract(callee, args)
} else {
// EVM contract
if ok = useGas(gas, GasGetAccount); !ok {