[#7] Refactor common.CheckAlphabetWitness()
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
d8530284fd
commit
b9be2ac036
8 changed files with 27 additions and 43 deletions
|
@ -105,7 +105,9 @@ func Update(script []byte, manifest []byte, data interface{}) {
|
|||
alphabetKeys := roles.GetDesignatedByRole(roles.NeoFSAlphabet, uint32(blockHeight+1))
|
||||
alphabetCommittee := common.Multiaddress(alphabetKeys, true)
|
||||
|
||||
common.CheckAlphabetWitness(alphabetCommittee)
|
||||
if !runtime.CheckWitness(alphabetCommittee) {
|
||||
panic(common.ErrAlphabetWitnessFailed)
|
||||
}
|
||||
|
||||
contract.Call(interop.Hash160(management.Hash), "update",
|
||||
contract.All, script, manifest, common.AppendVersion(data))
|
||||
|
@ -265,8 +267,7 @@ func Withdraw(user interop.Hash160, amount int) {
|
|||
//
|
||||
// This method produces Cheque notification to burn assets in sidechain.
|
||||
func Cheque(id []byte, user interop.Hash160, amount int, lockAcc []byte) {
|
||||
multiaddr := AlphabetAddress()
|
||||
common.CheckAlphabetWitness(multiaddr)
|
||||
common.CheckAlphabetWitness()
|
||||
|
||||
from := runtime.GetExecutingScriptHash()
|
||||
|
||||
|
@ -331,8 +332,7 @@ func Config(key []byte) interface{} {
|
|||
func SetConfig(id, key, val []byte) {
|
||||
ctx := storage.GetContext()
|
||||
|
||||
multiaddr := AlphabetAddress()
|
||||
common.CheckAlphabetWitness(multiaddr)
|
||||
common.CheckAlphabetWitness()
|
||||
|
||||
setConfig(ctx, key, val)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue