parent
4254407a9b
commit
b431e47d2a
3 changed files with 68 additions and 2 deletions
|
@ -13,6 +13,21 @@ import (
|
|||
// Hash represents Ledger contract hash.
|
||||
const Hash = "\xbe\xf2\x04\x31\x40\x36\x2a\x77\xc1\x50\x99\xc7\xe6\x4c\x12\xf7\x00\xb6\x65\xda"
|
||||
|
||||
// VMState represents VM execution state.
|
||||
type VMState uint8
|
||||
|
||||
// Various VM execution states.
|
||||
const (
|
||||
// NoneState represents NONE VM state.
|
||||
NoneState VMState = 0
|
||||
// HaltState represents HALT VM state.
|
||||
HaltState VMState = 1
|
||||
// FaultState represents FAULT VM state.
|
||||
FaultState VMState = 2
|
||||
// BreakState represents BREAK VM state.
|
||||
BreakState VMState = 4
|
||||
)
|
||||
|
||||
// CurrentHash represents `currentHash` method of Ledger native contract.
|
||||
func CurrentHash() interop.Hash256 {
|
||||
return neogointernal.CallWithToken(Hash, "currentHash", int(contract.ReadStates)).(interop.Hash256)
|
||||
|
@ -43,3 +58,8 @@ func GetTransactionFromBlock(indexOrHash interface{}, txIndex int) *Transaction
|
|||
return neogointernal.CallWithToken(Hash, "getTransactionFromBlock", int(contract.ReadStates),
|
||||
indexOrHash, txIndex).(*Transaction)
|
||||
}
|
||||
|
||||
// GetTransactionVMState represents `getTransactionVMState` method of Ledger native contract.
|
||||
func GetTransactionVMState(hash interop.Hash256) VMState {
|
||||
return neogointernal.CallWithToken(Hash, "getTransactionVMState", int(contract.ReadStates), hash).(VMState)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue