mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
cleanup, drop ClearBase
This commit is contained in:
parent
e037093740
commit
ecd231a8eb
@ -10,8 +10,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
GlobalPermissionsAddress = Zero256[:20]
|
GlobalPermissionsAddress = Zero256[:20]
|
||||||
GlobalPermissionsAddress256 = Zero256
|
GlobalPermissionsAddress256 = Zero256
|
||||||
DougAddress = append([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, []byte("THISISDOUG")...)
|
|
||||||
DougAddress256 = LeftPadWord256(DougAddress)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// A particular permission
|
// A particular permission
|
||||||
@ -154,6 +152,9 @@ func (aP *AccountPermissions) RmRole(role string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
// string utilities
|
||||||
|
|
||||||
|
// CONTRACT: PermFlagToString functions assume the permFlag is valid, else return "#-UNKNOWN-#"
|
||||||
func PermFlagToString(pf PermFlag) string {
|
func PermFlagToString(pf PermFlag) string {
|
||||||
if pf < FirstSNativePermFlag {
|
if pf < FirstSNativePermFlag {
|
||||||
return BasePermFlagToString(pf)
|
return BasePermFlagToString(pf)
|
||||||
@ -178,6 +179,8 @@ func BasePermFlagToString(pf PermFlag) (perm string) {
|
|||||||
perm = "bond"
|
perm = "bond"
|
||||||
case Name:
|
case Name:
|
||||||
perm = "name"
|
perm = "name"
|
||||||
|
default:
|
||||||
|
perm = "#-UNKNOWN-#"
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -14,18 +14,17 @@ const (
|
|||||||
FirstSNativePermFlag PermFlag = 1 << 32
|
FirstSNativePermFlag PermFlag = 1 << 32
|
||||||
)
|
)
|
||||||
|
|
||||||
// we need to reset iota with no const block
|
// we need to reset iota with new const block
|
||||||
const (
|
const (
|
||||||
// each snative has an associated permission flag
|
// each snative has an associated permission flag
|
||||||
HasBase PermFlag = FirstSNativePermFlag << iota
|
HasBase PermFlag = FirstSNativePermFlag << iota
|
||||||
SetBase
|
SetBase
|
||||||
UnsetBase
|
UnsetBase
|
||||||
SetGlobal
|
SetGlobal
|
||||||
ClearBase
|
|
||||||
HasRole
|
HasRole
|
||||||
AddRole
|
AddRole
|
||||||
RmRole
|
RmRole
|
||||||
NumSNativePermissions uint = 8 // NOTE adjust this too
|
NumSNativePermissions uint = 7 // NOTE adjust this too
|
||||||
|
|
||||||
TopSNativePermFlag PermFlag = FirstSNativePermFlag << (NumSNativePermissions - 1)
|
TopSNativePermFlag PermFlag = FirstSNativePermFlag << (NumSNativePermissions - 1)
|
||||||
AllSNativePermFlags PermFlag = (TopSNativePermFlag | (TopSNativePermFlag - 1)) &^ (FirstSNativePermFlag - 1)
|
AllSNativePermFlags PermFlag = (TopSNativePermFlag | (TopSNativePermFlag - 1)) &^ (FirstSNativePermFlag - 1)
|
||||||
@ -34,9 +33,10 @@ const (
|
|||||||
//---------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------
|
||||||
// snative tx interface and argument encoding
|
// snative tx interface and argument encoding
|
||||||
|
|
||||||
// SNatives are represented as an interface in the SNative tx,
|
// SNativesArgs are a registered interface in the SNativeTx,
|
||||||
// so binary does the work of handling args and determining which snative we're calling
|
// so binary handles the arguments and each snative gets a type-byte
|
||||||
// NOTE: we're definining an implicit map from registration bytes to perm flags
|
// PermFlag() maps the type-byte to the permission
|
||||||
|
// The account sending the SNativeTx must have this PermFlag set
|
||||||
type SNativeArgs interface {
|
type SNativeArgs interface {
|
||||||
PermFlag() PermFlag
|
PermFlag() PermFlag
|
||||||
}
|
}
|
||||||
@ -46,10 +46,9 @@ const (
|
|||||||
SNativeArgsTypeSetBase = byte(0x02)
|
SNativeArgsTypeSetBase = byte(0x02)
|
||||||
SNativeArgsTypeUnsetBase = byte(0x03)
|
SNativeArgsTypeUnsetBase = byte(0x03)
|
||||||
SNativeArgsTypeSetGlobal = byte(0x04)
|
SNativeArgsTypeSetGlobal = byte(0x04)
|
||||||
SNativeArgsTypeClearBase = byte(0x05)
|
SNativeArgsTypeHasRole = byte(0x05)
|
||||||
SNativeArgsTypeHasRole = byte(0x06)
|
SNativeArgsTypeAddRole = byte(0x06)
|
||||||
SNativeArgsTypeAddRole = byte(0x07)
|
SNativeArgsTypeRmRole = byte(0x07)
|
||||||
SNativeArgsTypeRmRole = byte(0x08)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// for binary.readReflect
|
// for binary.readReflect
|
||||||
@ -59,7 +58,6 @@ var _ = binary.RegisterInterface(
|
|||||||
binary.ConcreteType{&SetBaseArgs{}, SNativeArgsTypeSetBase},
|
binary.ConcreteType{&SetBaseArgs{}, SNativeArgsTypeSetBase},
|
||||||
binary.ConcreteType{&UnsetBaseArgs{}, SNativeArgsTypeUnsetBase},
|
binary.ConcreteType{&UnsetBaseArgs{}, SNativeArgsTypeUnsetBase},
|
||||||
binary.ConcreteType{&SetGlobalArgs{}, SNativeArgsTypeSetGlobal},
|
binary.ConcreteType{&SetGlobalArgs{}, SNativeArgsTypeSetGlobal},
|
||||||
binary.ConcreteType{&ClearBaseArgs{}, SNativeArgsTypeClearBase},
|
|
||||||
binary.ConcreteType{&HasRoleArgs{}, SNativeArgsTypeHasRole},
|
binary.ConcreteType{&HasRoleArgs{}, SNativeArgsTypeHasRole},
|
||||||
binary.ConcreteType{&AddRoleArgs{}, SNativeArgsTypeAddRole},
|
binary.ConcreteType{&AddRoleArgs{}, SNativeArgsTypeAddRole},
|
||||||
binary.ConcreteType{&RmRoleArgs{}, SNativeArgsTypeRmRole},
|
binary.ConcreteType{&RmRoleArgs{}, SNativeArgsTypeRmRole},
|
||||||
@ -102,14 +100,6 @@ func (*SetGlobalArgs) PermFlag() PermFlag {
|
|||||||
return SetGlobal
|
return SetGlobal
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClearBaseArgs struct {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ClearBaseArgs) PermFlag() PermFlag {
|
|
||||||
return ClearBase
|
|
||||||
}
|
|
||||||
|
|
||||||
type HasRoleArgs struct {
|
type HasRoleArgs struct {
|
||||||
Address []byte
|
Address []byte
|
||||||
Role string
|
Role string
|
||||||
@ -150,8 +140,6 @@ func SNativePermFlagToString(pF PermFlag) (perm string) {
|
|||||||
perm = "UnsetBase"
|
perm = "UnsetBase"
|
||||||
case SetGlobal:
|
case SetGlobal:
|
||||||
perm = "SetGlobal"
|
perm = "SetGlobal"
|
||||||
case ClearBase:
|
|
||||||
perm = "ClearBase"
|
|
||||||
case HasRole:
|
case HasRole:
|
||||||
perm = "HasRole"
|
perm = "HasRole"
|
||||||
case AddRole:
|
case AddRole:
|
||||||
@ -174,8 +162,6 @@ func SNativeStringToPermFlag(perm string) (pF PermFlag, err error) {
|
|||||||
pF = UnsetBase
|
pF = UnsetBase
|
||||||
case "SetGlobal":
|
case "SetGlobal":
|
||||||
pF = SetGlobal
|
pF = SetGlobal
|
||||||
case "ClearBase":
|
|
||||||
pF = ClearBase
|
|
||||||
case "HasRole":
|
case "HasRole":
|
||||||
pF = HasRole
|
pF = HasRole
|
||||||
case "AddRole":
|
case "AddRole":
|
||||||
|
@ -807,7 +807,7 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
|
|||||||
permFlag := tx.SNative.PermFlag()
|
permFlag := tx.SNative.PermFlag()
|
||||||
// check permission
|
// check permission
|
||||||
if !hasSNativePermission(blockCache, inAcc, permFlag) {
|
if !hasSNativePermission(blockCache, inAcc, permFlag) {
|
||||||
return fmt.Errorf("Account %X does not have permission to call snative %s (%b)", tx.Input.Address, tx.SNative, permFlag)
|
return fmt.Errorf("Account %X does not have permission to call snative %s (%b)", tx.Input.Address, ptypes.SNativePermFlagToString(permFlag), permFlag)
|
||||||
}
|
}
|
||||||
|
|
||||||
// pubKey should be present in either "inAcc" or "tx.Input"
|
// pubKey should be present in either "inAcc" or "tx.Input"
|
||||||
@ -843,11 +843,9 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
|
|||||||
err = permAcc.Permissions.Base.Unset(args.Permission)
|
err = permAcc.Permissions.Base.Unset(args.Permission)
|
||||||
case *ptypes.SetGlobalArgs:
|
case *ptypes.SetGlobalArgs:
|
||||||
if permAcc = blockCache.GetAccount(ptypes.GlobalPermissionsAddress); permAcc == nil {
|
if permAcc = blockCache.GetAccount(ptypes.GlobalPermissionsAddress); permAcc == nil {
|
||||||
// PanicSanity("can't find global permissions account")
|
PanicSanity("can't find global permissions account")
|
||||||
}
|
}
|
||||||
err = permAcc.Permissions.Base.Set(args.Permission, args.Value)
|
err = permAcc.Permissions.Base.Set(args.Permission, args.Value)
|
||||||
case *ptypes.ClearBaseArgs:
|
|
||||||
//
|
|
||||||
case *ptypes.HasRoleArgs:
|
case *ptypes.HasRoleArgs:
|
||||||
return fmt.Errorf("HasRole is for contracts, not humans. Just look at the blockchain")
|
return fmt.Errorf("HasRole is for contracts, not humans. Just look at the blockchain")
|
||||||
case *ptypes.AddRoleArgs:
|
case *ptypes.AddRoleArgs:
|
||||||
@ -865,7 +863,7 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
|
|||||||
return fmt.Errorf("Role (%s) does not exist for account %X", args.Role, args.Address)
|
return fmt.Errorf("Role (%s) does not exist for account %X", args.Role, args.Address)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// PanicSanity("invalid snative")
|
PanicSanity(Fmt("invalid snative: %s", ptypes.SNativePermFlagToString(permFlag)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: maybe we want to take funds on error and allow txs in that don't do anythingi?
|
// TODO: maybe we want to take funds on error and allow txs in that don't do anythingi?
|
||||||
|
@ -836,6 +836,9 @@ func TestCreateAccountPermission(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// holla at my boy
|
||||||
|
var DougAddress = append([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, []byte("THISISDOUG")...)
|
||||||
|
|
||||||
func TestSNativeCALL(t *testing.T) {
|
func TestSNativeCALL(t *testing.T) {
|
||||||
stateDB := dbm.GetDB("state")
|
stateDB := dbm.GetDB("state")
|
||||||
genDoc := newBaseGenDoc(PermsAllFalse, PermsAllFalse)
|
genDoc := newBaseGenDoc(PermsAllFalse, PermsAllFalse)
|
||||||
@ -851,7 +854,7 @@ func TestSNativeCALL(t *testing.T) {
|
|||||||
|
|
||||||
// make the main contract once
|
// make the main contract once
|
||||||
doug := &acm.Account{
|
doug := &acm.Account{
|
||||||
Address: ptypes.DougAddress,
|
Address: DougAddress,
|
||||||
Balance: 0,
|
Balance: 0,
|
||||||
Code: nil,
|
Code: nil,
|
||||||
Sequence: 0,
|
Sequence: 0,
|
||||||
@ -925,9 +928,6 @@ func TestSNativeCALL(t *testing.T) {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
// ClearBase
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
fmt.Println("\n#### HasRole")
|
fmt.Println("\n#### HasRole")
|
||||||
// HasRole
|
// HasRole
|
||||||
snativeAddress, data = snativeRoleTestInputCALL("HasRole", user[3], "bumble")
|
snativeAddress, data = snativeRoleTestInputCALL("HasRole", user[3], "bumble")
|
||||||
@ -1022,9 +1022,6 @@ func TestSNativeTx(t *testing.T) {
|
|||||||
t.Fatal("expected permission to be set true")
|
t.Fatal("expected permission to be set true")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearBase
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
fmt.Println("\n#### AddRole")
|
fmt.Println("\n#### AddRole")
|
||||||
// AddRole
|
// AddRole
|
||||||
snativeArgs = snativeRoleTestInputTx("AddRole", user[3], "chuck")
|
snativeArgs = snativeRoleTestInputTx("AddRole", user[3], "chuck")
|
||||||
@ -1184,7 +1181,6 @@ func snativePermTestInputCALL(name string, user *acm.PrivAccount, perm ptypes.Pe
|
|||||||
case "SetGlobal":
|
case "SetGlobal":
|
||||||
data = Uint64ToWord256(uint64(perm)).Bytes()
|
data = Uint64ToWord256(uint64(perm)).Bytes()
|
||||||
data = append(data, boolToWord256(val).Bytes()...)
|
data = append(data, boolToWord256(val).Bytes()...)
|
||||||
case "ClearBase":
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1199,7 +1195,6 @@ func snativePermTestInputTx(name string, user *acm.PrivAccount, perm ptypes.Perm
|
|||||||
snativeArgs = &ptypes.SetBaseArgs{user.Address, perm, val}
|
snativeArgs = &ptypes.SetBaseArgs{user.Address, perm, val}
|
||||||
case "SetGlobal":
|
case "SetGlobal":
|
||||||
snativeArgs = &ptypes.SetGlobalArgs{perm, val}
|
snativeArgs = &ptypes.SetGlobalArgs{perm, val}
|
||||||
case "ClearBase":
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ type snativeInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Takes an appState so it can lookup/update accounts,
|
// Takes an appState so it can lookup/update accounts,
|
||||||
// an account to check for permission to access the snative contract
|
// and an input byte array containing at least one Word256
|
||||||
// and some input bytes (presumably 32byte words)
|
// TODO: ABI
|
||||||
type SNativeContract func(appState AppState, acc *Account, input []byte) (output []byte, err error)
|
type SNativeContract func(appState AppState, input []byte) (output []byte, err error)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
// Registered SNative contracts
|
// Registered SNative contracts
|
||||||
@ -28,15 +28,13 @@ func getSNativeInfo(permFlag ptypes.PermFlag) *snativeInfo {
|
|||||||
var errS string
|
var errS string
|
||||||
switch permFlag {
|
switch permFlag {
|
||||||
case ptypes.HasBase:
|
case ptypes.HasBase:
|
||||||
si.NArgs, errS, si.Executable = 2, "hasBasePerm() takes two arguments (address, permission number)", hasBasePerm
|
si.NArgs, errS, si.Executable = 2, "hasBase() takes two arguments (address, permFlag)", hasBasePerm
|
||||||
case ptypes.SetBase:
|
case ptypes.SetBase:
|
||||||
si.NArgs, errS, si.Executable = 3, "setBasePerm() takes three arguments (address, permission number, permission value)", setBasePerm
|
si.NArgs, errS, si.Executable = 3, "setBase() takes three arguments (address, permFlag, permission value)", setBasePerm
|
||||||
case ptypes.UnsetBase:
|
case ptypes.UnsetBase:
|
||||||
si.NArgs, errS, si.Executable = 2, "unsetBasePerm() takes two arguments (address, permission number)", unsetBasePerm
|
si.NArgs, errS, si.Executable = 2, "unsetBase() takes two arguments (address, permFlag)", unsetBasePerm
|
||||||
case ptypes.SetGlobal:
|
case ptypes.SetGlobal:
|
||||||
si.NArgs, errS, si.Executable = 2, "setGlobalPerm() takes two arguments (permission number, permission value)", setGlobalPerm
|
si.NArgs, errS, si.Executable = 2, "setGlobal() takes two arguments (permFlag, permission value)", setGlobalPerm
|
||||||
case ptypes.ClearBase:
|
|
||||||
//
|
|
||||||
case ptypes.HasRole:
|
case ptypes.HasRole:
|
||||||
si.NArgs, errS, si.Executable = 2, "hasRole() takes two arguments (address, role)", hasRole
|
si.NArgs, errS, si.Executable = 2, "hasRole() takes two arguments (address, role)", hasRole
|
||||||
case ptypes.AddRole:
|
case ptypes.AddRole:
|
||||||
@ -56,7 +54,7 @@ func getSNativeInfo(permFlag ptypes.PermFlag) *snativeInfo {
|
|||||||
|
|
||||||
// TODO: catch errors, log em, return 0s to the vm (should some errors cause exceptions though?)
|
// TODO: catch errors, log em, return 0s to the vm (should some errors cause exceptions though?)
|
||||||
|
|
||||||
func hasBasePerm(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func hasBasePerm(appState AppState, args []byte) (output []byte, err error) {
|
||||||
addr, permNum := returnTwoArgs(args)
|
addr, permNum := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -76,7 +74,7 @@ func hasBasePerm(appState AppState, acc *Account, args []byte) (output []byte, e
|
|||||||
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setBasePerm(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func setBasePerm(appState AppState, args []byte) (output []byte, err error) {
|
||||||
addr, permNum, perm := returnThreeArgs(args)
|
addr, permNum, perm := returnThreeArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -95,7 +93,7 @@ func setBasePerm(appState AppState, acc *Account, args []byte) (output []byte, e
|
|||||||
return perm.Bytes(), nil
|
return perm.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func unsetBasePerm(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func unsetBasePerm(appState AppState, args []byte) (output []byte, err error) {
|
||||||
addr, permNum := returnTwoArgs(args)
|
addr, permNum := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -113,7 +111,7 @@ func unsetBasePerm(appState AppState, acc *Account, args []byte) (output []byte,
|
|||||||
return permNum.Bytes(), nil
|
return permNum.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setGlobalPerm(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func setGlobalPerm(appState AppState, args []byte) (output []byte, err error) {
|
||||||
permNum, perm := returnTwoArgs(args)
|
permNum, perm := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(ptypes.GlobalPermissionsAddress256)
|
vmAcc := appState.GetAccount(ptypes.GlobalPermissionsAddress256)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -132,12 +130,7 @@ func setGlobalPerm(appState AppState, acc *Account, args []byte) (output []byte,
|
|||||||
return perm.Bytes(), nil
|
return perm.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: needs access to an iterator ...
|
func hasRole(appState AppState, args []byte) (output []byte, err error) {
|
||||||
func clearPerm(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func hasRole(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
|
||||||
addr, role := returnTwoArgs(args)
|
addr, role := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -154,7 +147,7 @@ func hasRole(appState AppState, acc *Account, args []byte) (output []byte, err e
|
|||||||
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func addRole(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func addRole(appState AppState, args []byte) (output []byte, err error) {
|
||||||
addr, role := returnTwoArgs(args)
|
addr, role := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
@ -172,7 +165,7 @@ func addRole(appState AppState, acc *Account, args []byte) (output []byte, err e
|
|||||||
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
return LeftPadWord256([]byte{permInt}).Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func rmRole(appState AppState, acc *Account, args []byte) (output []byte, err error) {
|
func rmRole(appState AppState, args []byte) (output []byte, err error) {
|
||||||
addr, role := returnTwoArgs(args)
|
addr, role := returnTwoArgs(args)
|
||||||
vmAcc := appState.GetAccount(addr)
|
vmAcc := appState.GetAccount(addr)
|
||||||
if vmAcc == nil {
|
if vmAcc == nil {
|
||||||
|
2
vm/vm.go
2
vm/vm.go
@ -127,7 +127,7 @@ func (vm *VM) callSNative(addr Word256, permFlag ptypes.PermFlag, caller *Accoun
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// SNATIVE ACCESS
|
// SNATIVE ACCESS
|
||||||
ret, err = snInfo.Executable(vm.appState, caller, input)
|
ret, err = snInfo.Executable(vm.appState, input)
|
||||||
// END SNATIVE ACCESS
|
// END SNATIVE ACCESS
|
||||||
if err != nil {
|
if err != nil {
|
||||||
*exception = err.Error()
|
*exception = err.Error()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user