neoneo-go/pkg/vm/api/runtime/runtime.go
Anthony De Meulemeester 4bd5b2812e
Optimisations and API changes for smart contracts (#67)
* support VM to pass method and arguments to a script.

* added support for type assertions in smartcontracts.

* added native vm support for print.

* moved VM API packages to vm -> API

* reverted the native Print opcode in favor of runtime.Log

* added support for registering custom interop hooks in the VM.

* Updated README

* Updated compiler with @OPTIMIZE tags

* Moved more tests to VM package.

* optimized and refactored compiler and vm API

* updated README with new smartcontract apis

* bumped version
2018-04-10 11:45:31 +02:00

40 lines
928 B
Go

package runtime
import "github.com/CityOfZion/neo-go/pkg/vm/api/types"
// CheckWitness verifies if the invoker is the owner of the contract.
func CheckWitness(hash []byte) bool {
return true
}
// GetCurrentBlock returns the current block.
func GetCurrentBlock() types.Block { return types.Block{} }
// GetTime returns the timestamp of the most recent block.
func GetTime() int {
return 0
}
// Notify an event to the VM.
func Notify(arg interface{}) int {
return 0
}
// Log intructs the VM to log the given message.
func Log(message string) {}
// Application returns the application trigger type.
func Application() byte {
return 0x10
}
// Verification returns the verification trigger type.
func Verification() byte {
return 0x00
}
// GetTrigger return the current trigger type. The return in this function
// doesn't really mather, this is just an interop placeholder.
func GetTrigger() interface{} {
return 0
}