From e7619218f84e399fa46e165237592cdd5756db5a Mon Sep 17 00:00:00 2001 From: Casey Kuhlman <casey@erisindustries.com> Date: Thu, 9 Jun 2016 22:33:37 +0200 Subject: [PATCH] changes to fix permissions -> evm connection --- .../tendermint/tendermint/permission/types/permissions.go | 2 +- .../src/github.com/tendermint/tendermint/vm/snative.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/permission/types/permissions.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/permission/types/permissions.go index 3fa8f3dc..fed65416 100644 --- a/Godeps/_workspace/src/github.com/tendermint/tendermint/permission/types/permissions.go +++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/permission/types/permissions.go @@ -135,7 +135,7 @@ func (aP *AccountPermissions) HasRole(role string) bool { // Returns true if the role is added, and false if it already exists func (aP *AccountPermissions) AddRole(role string) bool { - role = string(LeftPadBytes([]byte(role), 32)) + role = string(RightPadBytes([]byte(role), 32)) for _, r := range aP.Roles { if r == role { return false diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/snative.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/snative.go index b497364d..c62e948d 100644 --- a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/snative.go +++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/snative.go @@ -53,13 +53,14 @@ contract Permissions { // function identifiers from the solidity abi var PermsMap = map[string]SNativeFuncDescription{ - "054556ac": SNativeFuncDescription{"has_role", 2, ptypes.HasRole, has_role}, + //"054556ac": SNativeFuncDescription{"has_role", 2, ptypes.HasRole, has_role}, + "e8145855": SNativeFuncDescription{"has_role", 2, ptypes.HasRole, has_role}, "180d26f2": SNativeFuncDescription{"unset_base", 2, ptypes.UnsetBase, unset_base}, "3a3fcc59": SNativeFuncDescription{"set_global", 2, ptypes.SetGlobal, set_global}, - "9a1c4141": SNativeFuncDescription{"add_role", 2, ptypes.AddRole, add_role}, + "3fbf7da5": SNativeFuncDescription{"add_role", 2, ptypes.AddRole, add_role}, "9ea53314": SNativeFuncDescription{"set_base", 3, ptypes.SetBase, set_base}, "bb37737a": SNativeFuncDescription{"has_base", 2, ptypes.HasBase, has_base}, - "ded3350a": SNativeFuncDescription{"rm_role", 2, ptypes.RmRole, rm_role}, + "28fd0194": SNativeFuncDescription{"rm_role", 2, ptypes.RmRole, rm_role}, } func permissionsContract(appState AppState, caller *Account, args []byte, gas *int64) (output []byte, err error) { -- GitLab