2020-10-12 10:17:40 +00:00
|
|
|
package invoke
|
|
|
|
|
|
|
|
import (
|
2020-11-13 11:37:05 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
2020-10-12 10:17:40 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
emitMethod = "emit"
|
2020-11-13 11:37:05 +00:00
|
|
|
voteMethod = "vote"
|
2020-10-12 10:17:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// AlphabetEmit invokes emit method on alphabet contract.
|
|
|
|
func AlphabetEmit(cli *client.Client, con util.Uint160) error {
|
|
|
|
if cli == nil {
|
|
|
|
return client.ErrNilClient
|
|
|
|
}
|
|
|
|
|
|
|
|
// there is no signature collecting, so we don't need extra fee
|
|
|
|
return cli.Invoke(con, 0, emitMethod)
|
|
|
|
}
|
2020-11-13 11:37:05 +00:00
|
|
|
|
|
|
|
// AlphabetVote invokes vote method on alphabet contract.
|
2021-04-29 13:39:09 +00:00
|
|
|
func AlphabetVote(cli *client.Client, con util.Uint160, fee SideFeeProvider, epoch uint64, keys keys.PublicKeys) error {
|
2020-11-13 11:37:05 +00:00
|
|
|
if cli == nil {
|
|
|
|
return client.ErrNilClient
|
|
|
|
}
|
|
|
|
|
2021-04-29 13:39:09 +00:00
|
|
|
if !cli.NotaryEnabled() {
|
|
|
|
return cli.Invoke(con, fee.SideChainFee(), voteMethod, int64(epoch), keys)
|
|
|
|
}
|
|
|
|
|
2021-03-25 07:34:27 +00:00
|
|
|
return cli.NotaryInvoke(con, voteMethod, int64(epoch), keys)
|
2020-11-13 11:37:05 +00:00
|
|
|
}
|