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

Function SetNeoServiceParamAndEngine

smartcontract/service/util/util.go:70–88  ·  view source on GitHub ↗
(addr common.Address, engine context.Engine, stack *neovm.ValueStack)

Source from the content-addressed store, hash-verified

68}
69
70func SetNeoServiceParamAndEngine(addr common.Address, engine context.Engine, stack *neovm.ValueStack) error {
71 service, ok := engine.(*neovms.NeoVmService)
72 if ok == false {
73 return errors.New("engine should be NeoVmService")
74 }
75
76 code, err := service.GetNeoContract(addr)
77 if err != nil {
78 return err
79 }
80
81 feature := service.Engine.Features
82 service.Engine = neovm.NewExecutor(code, feature)
83 service.Code = code
84
85 service.Engine.EvalStack = stack
86
87 return nil
88}

Callers 1

CallContractFunction · 0.92

Calls 2

NewExecutorFunction · 0.92
GetNeoContractMethod · 0.80

Tested by

no test coverage detected