compiler|transaction: fix transaction.GetScript build, add to interop

There is no such syscall as Neo.Transaction.GetScript and GetScript should be
available for contract's use.
This commit is contained in:
Roman Khimov 2020-05-18 18:22:07 +03:00
parent d0a3ce25ff
commit 514f862b81
2 changed files with 8 additions and 1 deletions

View file

@ -69,7 +69,7 @@ var syscalls = map[string]map[string]string{
"GetOutputs": "Neo.Transaction.GetOutputs",
"GetReferences": "Neo.Transaction.GetReferences",
"GetUnspentCoins": "Neo.Transaction.GetUnspentCoins",
"GetScript": "Neo.Transaction.GetScript",
"GetScript": "Neo.InvocationTransaction.GetScript",
},
"asset": {
"Create": "Neo.Asset.Create",

View file

@ -48,3 +48,10 @@ func GetInputs(t Transaction) []input.Input {
func GetOutputs(t Transaction) []output.Output {
return []output.Output{}
}
// GetScript returns the script stored in a given Invocation transaction.
// Calling it for any other Transaction type would lead to failure. It uses
// `Neo.InvocationTransaction.GetScript` syscall.
func GetScript(t Transaction) []byte {
return nil
}