forked from TrueCloudLab/neoneo-go
Merge pull request #3035 from nspcc-dev/fix-rpcbinding
rpcbinding: convert `scriptFor*` from function to method
This commit is contained in:
commit
f96ccf2bfe
3 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue