forked from TrueCloudLab/frostfs-contract
[#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:
parent
72574e56eb
commit
f8190f7a91
8 changed files with 104 additions and 0 deletions
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
|
@ -111,6 +111,19 @@ func Emit() bool {
|
|||
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 {
|
||||
return name
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue