native: don't push void result in Call
This was done in https://github.com/neo-project/neo/pull/1693 for native calls. `OnPersist` script still uses `DROP` though as value is pushed via `CheckReturn` logic for regular calls.
This commit is contained in:
parent
877b8ece63
commit
30526046e7
3 changed files with 7 additions and 2 deletions
|
@ -82,6 +82,7 @@ type Method = func(ic *Context, args []stackitem.Item) stackitem.Item
|
|||
// MethodAndPrice is a native-contract method descriptor.
|
||||
type MethodAndPrice struct {
|
||||
Func Method
|
||||
MD *manifest.Method
|
||||
Price int64
|
||||
RequiredFlags smartcontract.CallFlag
|
||||
}
|
||||
|
@ -123,6 +124,7 @@ func NewContractMD(name string) *ContractMD {
|
|||
// AddMethod adds new method to a native contract.
|
||||
func (c *ContractMD) AddMethod(md *MethodAndPrice, desc *manifest.Method, safe bool) {
|
||||
c.Manifest.ABI.Methods = append(c.Manifest.ABI.Methods, *desc)
|
||||
md.MD = desc
|
||||
c.Methods[desc.Name] = *md
|
||||
if safe {
|
||||
c.Manifest.SafeMethods.Add(desc.Name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue