rpcbinding: convert scriptFor* from function to method

Should be a part of #3012, otherwise generated bindings are failed to
be compiled.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-06-05 17:47:17 +03:00
parent 805157b7a0
commit c7836ed6e7
3 changed files with 3 additions and 3 deletions

View file

@ -194,7 +194,7 @@ func (c *Contract) SetPriceUnsigned(priceList []any) (*transaction.Transaction,
return c.actor.MakeUnsignedCall(c.hash, "setPrice", nil, priceList)
}
func scriptForRegister(name string, owner util.Uint160) ([]byte, error) {
func (c *Contract) scriptForRegister(name string, owner util.Uint160) ([]byte, error) {
return smartcontract.CreateCallWithAssertScript(c.hash, "register", name, owner)
}

View file

@ -41,7 +41,7 @@ func New(actor Actor) *Contract {
return &Contract{actor, hash}
}
func scriptForVerify() ([]byte, error) {
func (c *Contract) scriptForVerify() ([]byte, error) {
return smartcontract.CreateCallWithAssertScript(c.hash, "verify")
}

View file

@ -58,7 +58,7 @@ func (c *ContractReader) {{.Name}}Expanded({{range $index, $arg := .Arguments}}{
}
{{ end }}{{ end }}`
methodDefinition = `{{ define "METHOD" }}{{ if eq .ReturnType "bool"}}
func scriptFor{{.Name}}({{range $index, $arg := .Arguments -}}
func (c *Contract) scriptFor{{.Name}}({{range $index, $arg := .Arguments -}}
{{- if ne $index 0}}, {{end}}
{{- .Name}} {{.Type}}
{{- end}}) ([]byte, error) {