mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
native: add additional parameters to deploy
1. Management contract has 2 overloads of `deploy` method. 2. Normal contracts should have `_deploy` with 2 parameters.
This commit is contained in:
parent
849385a533
commit
c1cc7e6f9d
10 changed files with 149 additions and 32 deletions
|
@ -53,7 +53,7 @@ func MethodParams(addr interop.Hash160, h interop.Hash256,
|
|||
type MyStruct struct {}
|
||||
func (ms MyStruct) MethodOnStruct() { }
|
||||
func (ms *MyStruct) MethodOnPointerToStruct() { }
|
||||
func _deploy(isUpdate bool) {}
|
||||
func _deploy(data interface{}, isUpdate bool) {}
|
||||
`
|
||||
|
||||
info, err := getBuildInfo("foo.go", src)
|
||||
|
@ -100,11 +100,18 @@ func _deploy(isUpdate bool) {}
|
|||
|
||||
t.Run("param types", func(t *testing.T) {
|
||||
paramTypes := map[string][]DebugParam{
|
||||
"_deploy": {{
|
||||
Name: "isUpdate",
|
||||
Type: "Boolean",
|
||||
TypeSC: smartcontract.BoolType,
|
||||
}},
|
||||
"_deploy": {
|
||||
{
|
||||
Name: "data",
|
||||
Type: "Any",
|
||||
TypeSC: smartcontract.AnyType,
|
||||
},
|
||||
{
|
||||
Name: "isUpdate",
|
||||
Type: "Boolean",
|
||||
TypeSC: smartcontract.BoolType,
|
||||
},
|
||||
},
|
||||
"MethodInt": {{
|
||||
Name: "a",
|
||||
Type: "ByteString",
|
||||
|
@ -160,6 +167,7 @@ func _deploy(isUpdate bool) {}
|
|||
Name: "_deploy",
|
||||
Offset: 0,
|
||||
Parameters: []manifest.Parameter{
|
||||
manifest.NewParameter("data", smartcontract.AnyType),
|
||||
manifest.NewParameter("isUpdate", smartcontract.BoolType),
|
||||
},
|
||||
ReturnType: smartcontract.VoidType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue