core: implement System.Contract.Call interop

This commit is contained in:
Evgenii Stratonikov 2020-05-07 14:11:59 +03:00
parent 301c1b7601
commit ec900c7ff7
4 changed files with 51 additions and 14 deletions

View file

@ -5,6 +5,7 @@ import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/interop"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
@ -85,6 +86,9 @@ func TestNativeContract_Invoke(t *testing.T) {
tn := newTestNative()
chain.registerNative(tn)
err := chain.dao.PutContractState(&state.Contract{Script: tn.meta.Script})
require.NoError(t, err)
w := io.NewBufBinWriter()
emit.AppCallWithOperationAndArgs(w.BinWriter, tn.Metadata().Hash, "sum", int64(14), int64(28))
script := w.Bytes()