From 0541d83cf442510eb94003ae60bf5ea008940721 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 4 Feb 2021 10:20:07 +0300 Subject: [PATCH] [#42] common: Replace InvokeID function to vote.go source file Signed-off-by: Leonard Lyubich --- common/invoke.go | 10 ---------- common/vote.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/invoke.go b/common/invoke.go index 7369193..194405d 100644 --- a/common/invoke.go +++ b/common/invoke.go @@ -1,19 +1,9 @@ package common import ( - "github.com/nspcc-dev/neo-go/pkg/interop/crypto" "github.com/nspcc-dev/neo-go/pkg/interop/runtime" ) -func InvokeID(args []interface{}, prefix []byte) []byte { - for i := range args { - arg := args[i].([]byte) - prefix = append(prefix, arg...) - } - - return crypto.SHA256(prefix) -} - type IRNode struct { PublicKey []byte } diff --git a/common/vote.go b/common/vote.go index 09d410f..3ae57fa 100644 --- a/common/vote.go +++ b/common/vote.go @@ -3,6 +3,7 @@ package common import ( "github.com/nspcc-dev/neo-go/pkg/interop/binary" "github.com/nspcc-dev/neo-go/pkg/interop/blockchain" + "github.com/nspcc-dev/neo-go/pkg/interop/crypto" "github.com/nspcc-dev/neo-go/pkg/interop/storage" "github.com/nspcc-dev/neo-go/pkg/interop/util" ) @@ -107,3 +108,12 @@ func getBallots(ctx storage.Context) []Ballot { func BytesEqual(a []byte, b []byte) bool { return util.Equals(string(a), string(b)) } + +func InvokeID(args []interface{}, prefix []byte) []byte { + for i := range args { + arg := args[i].([]byte) + prefix = append(prefix, arg...) + } + + return crypto.SHA256(prefix) +}