[#19] alphabet: Add vote method

Alphabet contracts are holders of NEO token in sidechain.
Inner ring nodes control sidechain validators list through
voting of alphabet contracts.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-12 16:52:14 +03:00 committed by Alex Vanin
parent 72574e56eb
commit f8190f7a91
8 changed files with 104 additions and 0 deletions

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }

View file

@ -111,6 +111,19 @@ func Emit() bool {
return true return true
} }
func Vote(candidate []byte) {
innerRingKeys := irList()
if !checkPermission(innerRingKeys) {
panic("invalid invoker")
}
address := runtime.GetExecutingScriptHash()
_ = engine.AppCall([]byte(neoHash), "vote", address, candidate)
return
}
func Name() string { func Name() string {
return name return name
} }