compiler/interop: expose GetTransactionHeight

And sort syscall names as they change the indentation anyway.
This commit is contained in:
Roman Khimov 2020-05-17 23:35:56 +03:00
parent afe23ce239
commit 14409addd9
2 changed files with 16 additions and 8 deletions

View file

@ -31,14 +31,15 @@ var syscalls = map[string]map[string]string{
"Deserialize": "Neo.Runtime.Deserialize",
},
"blockchain": {
"GetHeight": "Neo.Blockchain.GetHeight",
"GetHeader": "Neo.Blockchain.GetHeader",
"GetBlock": "Neo.Blockchain.GetBlock",
"GetTransaction": "Neo.Blockchain.GetTransaction",
"GetContract": "Neo.Blockchain.GetContract",
"GetAccount": "Neo.Blockchain.GetAccount",
"GetValidators": "Neo.Blockchain.GetValidators",
"GetAsset": "Neo.Blockchain.GetAsset",
"GetAccount": "Neo.Blockchain.GetAccount",
"GetAsset": "Neo.Blockchain.GetAsset",
"GetBlock": "Neo.Blockchain.GetBlock",
"GetContract": "Neo.Blockchain.GetContract",
"GetHeader": "Neo.Blockchain.GetHeader",
"GetHeight": "Neo.Blockchain.GetHeight",
"GetTransaction": "Neo.Blockchain.GetTransaction",
"GetTransactionHeight": "Neo.Blockchain.GetTransactionHeight",
"GetValidators": "Neo.Blockchain.GetValidators",
},
"header": {
"GetIndex": "Neo.Header.GetIndex",

View file

@ -44,6 +44,13 @@ func GetTransaction(hash []byte) transaction.Transaction {
return transaction.Transaction{}
}
// GetTransactionHeight returns transaction's height (index of the block that
// includes it) by the given ID (256 bit in BE format represented as a slice of
// 32 bytes). This function uses `Neo.Blockchain.GetTransactionHeight` syscall.
func GetTransactionHeight(hash []byte) int {
return 0
}
// GetContract returns contract found by the given script hash (160 bit in BE
// format represented as a slice of 20 bytes). Refer to the `contract` package
// for details on how to use the returned structure. This function uses