Merge pull request #3035 from nspcc-dev/fix-rpcbinding

rpcbinding: convert `scriptFor*` from function to method
This commit is contained in:
Roman Khimov 2023-06-05 18:00:40 +03:00 committed by GitHub
commit f96ccf2bfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) 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) return smartcontract.CreateCallWithAssertScript(c.hash, "register", name, owner)
} }

View file

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

View file

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