native: check for committee in setters

This commit is contained in:
Evgeniy Stratonikov 2021-01-21 15:05:15 +03:00
parent 24d9a31476
commit c6894f3f55
9 changed files with 61 additions and 81 deletions

View file

@ -4,8 +4,6 @@ import (
"encoding/binary"
"github.com/nspcc-dev/neo-go/pkg/core/dao"
"github.com/nspcc-dev/neo-go/pkg/core/interop"
"github.com/nspcc-dev/neo-go/pkg/core/interop/runtime"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/storage"
"github.com/nspcc-dev/neo-go/pkg/io"
@ -65,14 +63,6 @@ func setUint32WithKey(id int32, dao dao.DAO, key []byte, value uint32) error {
return dao.PutStorageItem(id, key, si)
}
func checkValidators(ic *interop.Context) (bool, error) {
prevBlock, err := ic.Chain.GetBlock(ic.Block.PrevHash)
if err != nil {
return false, err
}
return runtime.CheckHashedWitness(ic, prevBlock.NextConsensus)
}
// makeUint160Key creates a key from account script hash.
func makeUint160Key(prefix byte, h util.Uint160) []byte {
k := make([]byte, util.Uint160Size+1)