interop: provide missing smartcontract parameter type defs

Contract can have Hash160, Hash256, Signature etc. types which
all map to a `[]byte` in Go. Having synonyms helps us to generate
proper manifest file.
This commit is contained in:
Evgenii Stratonikov 2020-08-28 10:47:15 +03:00
parent 49e9c1aa0f
commit cee1836183
10 changed files with 75 additions and 29 deletions

View file

@ -1,6 +1,9 @@
package runtime
import "github.com/nspcc-dev/neo-go/pkg/interop/blockchain"
import (
"github.com/nspcc-dev/neo-go/pkg/interop"
"github.com/nspcc-dev/neo-go/pkg/interop/blockchain"
)
// GetScriptContainer returns the transaction that initially triggered current
// execution context. It never changes in a single execution, no matter how deep
@ -15,7 +18,7 @@ func GetScriptContainer() blockchain.Transaction {
// AppCall can change the value returned by this function if it calls a
// different contract. This function uses
// `System.Runtime.GetExecutingScriptHash` syscall.
func GetExecutingScriptHash() []byte {
func GetExecutingScriptHash() interop.Hash160 {
return nil
}
@ -24,7 +27,7 @@ func GetExecutingScriptHash() []byte {
// running context (caller of current contract or function), so it's one level
// above the GetExecutingScriptHash in the call stack. It uses
// `System.Runtime.GetCallingScriptHash` syscall.
func GetCallingScriptHash() []byte {
func GetCallingScriptHash() interop.Hash160 {
return nil
}
@ -33,6 +36,6 @@ func GetCallingScriptHash() []byte {
// (this is a script that is contained in a transaction returned by
// GetScriptContainer) execution from the start. This function uses
// `System.Runtime.GetEntryScriptHash` syscall.
func GetEntryScriptHash() []byte {
func GetEntryScriptHash() interop.Hash160 {
return nil
}