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 80b8b50f02
commit 5d941364bd
2 changed files with 16 additions and 8 deletions

View file

@ -28,14 +28,15 @@ var syscalls = map[string]map[string]string{
"Deserialize": "Neo.Runtime.Deserialize", "Deserialize": "Neo.Runtime.Deserialize",
}, },
"blockchain": { "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", "GetAccount": "Neo.Blockchain.GetAccount",
"GetValidators": "Neo.Blockchain.GetValidators",
"GetAsset": "Neo.Blockchain.GetAsset", "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": { "header": {
"GetIndex": "Neo.Header.GetIndex", "GetIndex": "Neo.Header.GetIndex",

View file

@ -44,6 +44,13 @@ func GetTransaction(hash []byte) transaction.Transaction {
return 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 // 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 // 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 // for details on how to use the returned structure. This function uses