core: switch to the new voting system (via native NEO contract)

It has all the methods required now, so you can register, vote and get
voting results. Fixes #865.
This commit is contained in:
Roman Khimov 2020-04-26 20:04:16 +03:00
parent 2fa3bdf6a9
commit b83e84ca08
13 changed files with 42 additions and 399 deletions

View file

@ -479,22 +479,12 @@ func (s *service) getVerifiedTx(count int) []block.Transaction {
return res
}
func (s *service) getValidators(txx ...block.Transaction) []crypto.PublicKey {
func (s *service) getValidators(_ ...block.Transaction) []crypto.PublicKey {
var (
pKeys []*keys.PublicKey
err error
)
if len(txx) == 0 {
pKeys, err = s.Chain.GetValidators()
} else {
ntxx := make([]*transaction.Transaction, len(txx))
for i := range ntxx {
ntxx[i] = txx[i].(*transaction.Transaction)
}
pKeys, err = s.Chain.GetValidators(ntxx...)
}
pKeys, err = s.Chain.GetValidators()
if err != nil {
s.log.Error("error while trying to get validators", zap.Error(err))
}