[#625] morph/client: make method names constant

We don't use custom names and the only place where custom method option
is used it provides the default name and can be omitted.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-29 16:06:36 +03:00 committed by LeL
parent 35dec2f494
commit 3c5b62d839
44 changed files with 249 additions and 1097 deletions

View file

@ -46,13 +46,13 @@ func (x *commonBindArgs) SetKeys(v [][]byte) {
func (x *Client) BindKeys(args BindKeysArgs) error {
prm := client.InvokePrm{}
prm.SetMethod(x.bindKeysMethod)
prm.SetMethod(bindKeysMethod)
prm.SetArgs(args.scriptHash, args.keys)
prm.InvokePrmOptional = args.InvokePrmOptional
err := x.client.Invoke(prm)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", x.bindKeysMethod, err)
return fmt.Errorf("could not invoke method (%s): %w", bindKeysMethod, err)
}
return nil
@ -63,13 +63,13 @@ func (x *Client) BindKeys(args BindKeysArgs) error {
func (x *Client) UnbindKeys(args UnbindKeysArgs) error {
prm := client.InvokePrm{}
prm.SetMethod(x.unbindKeysMethod)
prm.SetMethod(unbindKeysMethod)
prm.SetArgs(args.scriptHash, args.keys)
prm.InvokePrmOptional = args.InvokePrmOptional
err := x.client.Invoke(prm)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", x.unbindKeysMethod, err)
return fmt.Errorf("could not invoke method (%s): %w", unbindKeysMethod, err)
}
return nil