From d02c24db5c6b97e1a037636bba6a0201a8cfdd48 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 13 Nov 2020 14:37:05 +0300 Subject: [PATCH] [#170] Add alphabet vote invocation method Signed-off-by: Alex Vanin --- pkg/innerring/invoke/alphabet.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/innerring/invoke/alphabet.go b/pkg/innerring/invoke/alphabet.go index 3621317f3..b1f8e2c48 100644 --- a/pkg/innerring/invoke/alphabet.go +++ b/pkg/innerring/invoke/alphabet.go @@ -1,12 +1,14 @@ package invoke import ( + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neofs-node/pkg/morph/client" ) const ( emitMethod = "emit" + voteMethod = "vote" ) // AlphabetEmit invokes emit method on alphabet contract. @@ -18,3 +20,13 @@ func AlphabetEmit(cli *client.Client, con util.Uint160) error { // there is no signature collecting, so we don't need extra fee return cli.Invoke(con, 0, emitMethod) } + +// AlphabetVote invokes vote method on alphabet contract. +func AlphabetVote(cli *client.Client, con util.Uint160, key keys.PublicKey) error { + if cli == nil { + return client.ErrNilClient + } + + // there is no signature collecting, so we don't need extra fee + return cli.Invoke(con, 0, voteMethod, key.Bytes()) +}