interop: fix the signature of Neo's GetCandidates interop API

This commit is contained in:
Anna Shaleva 2022-05-05 15:31:45 +03:00
parent 2a8ffd9318
commit 5e2a81ad03
2 changed files with 13 additions and 3 deletions

View file

@ -53,9 +53,10 @@ func GetCommittee() []interop.PublicKey {
return neogointernal.CallWithToken(Hash, "getCommittee", int(contract.ReadStates)).([]interop.PublicKey)
}
// GetCandidates represents `getCandidates` method of NEO native contract.
func GetCandidates() []interop.PublicKey {
return neogointernal.CallWithToken(Hash, "getCandidates", int(contract.ReadStates)).([]interop.PublicKey)
// GetCandidates represents `getCandidates` method of NEO native contract. It
// returns up to 256 candidates.
func GetCandidates() []Candidate {
return neogointernal.CallWithToken(Hash, "getCandidates", int(contract.ReadStates)).([]Candidate)
}
// GetNextBlockValidators represents `getNextBlockValidators` method of NEO native contract.

View file

@ -0,0 +1,9 @@
package neo
import "github.com/nspcc-dev/neo-go/pkg/interop"
// Candidate represents a single native Neo candidate.
type Candidate struct {
Key interop.PublicKey
Votes int
}