MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestBuildParamToNative

Function TestBuildParamToNative

smartcontract/test/native_test.go:32–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30)
31
32func TestBuildParamToNative(t *testing.T) {
33 code := `00c57676c84c0500000000004c1400000000000000000000000000000000000000060068164f6e746f6c6f67792e4e61746976652e496e766f6b65`
34
35 hex, err := common.HexToBytes(code)
36
37 if err != nil {
38 t.Fatal("hex to byte error:", err)
39 }
40
41 config := &smartcontract.Config{
42 Time: 10,
43 Height: 10,
44 Tx: nil,
45 }
46 sc := smartcontract.SmartContract{
47 Config: config,
48 Gas: 100000,
49 }
50 engine, err := sc.NewExecuteEngine(hex, types.InvokeNeo)
51
52 _, err = engine.Invoke()
53
54 assert.Error(t, err, "invoke smart contract err: [NeoVmService] service system call error!: [SystemCall] service execute error!: invoke native circular reference!")
55}

Callers

nothing calls this directly

Calls 5

NewExecuteEngineMethod · 0.95
HexToBytesFunction · 0.92
FatalMethod · 0.80
InvokeMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected