mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
d2ddf7b7cb
Allow to invoke methods by offset: 1. Every invoked contract must have manifest. 2. Check arguments count on invocation. 3. Change AppCall to a regular syscall. 4. Add test suite for `System.Contract.Call`.
18 lines
814 B
Go
18 lines
814 B
Go
/*
|
|
Package engine allows to make contract calls.
|
|
It's roughly similar in function to ExecutionEngine class in the Neo .net
|
|
framework.
|
|
*/
|
|
package engine
|
|
|
|
// AppCall executes previously deployed blockchain contract with specified hash
|
|
// (160 bit in BE form represented as 20-byte slice) using provided arguments.
|
|
// It returns whatever this contract returns. Even though this function accepts
|
|
// a slice for scriptHash you can only use it for contracts known at
|
|
// compile time, because there is a significant difference between static and
|
|
// dynamic calls in Neo (contracts should have a special property declared
|
|
// and paid for to be able to use dynamic calls). This function uses
|
|
// `System.Contract.Call` syscall.
|
|
func AppCall(scriptHash []byte, method string, args ...interface{}) interface{} {
|
|
return nil
|
|
}
|