From 84b4051b4da05e3a0433793c6de89fcb5b5e2e9c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 4 Dec 2024 15:28:33 +0300 Subject: [PATCH] [#1538] morph/container: Make opts struct similar to that of other contracts Signed-off-by: Evgenii Stratonikov --- pkg/morph/client/container/client.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/morph/client/container/client.go b/pkg/morph/client/container/client.go index 51aa1a93a..be684619b 100644 --- a/pkg/morph/client/container/client.go +++ b/pkg/morph/client/container/client.go @@ -46,7 +46,7 @@ func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts[i](o) } - sc, err := client.NewStatic(cli, contract, fee, o.staticOpts...) + sc, err := client.NewStatic(cli, contract, fee, *o...) if err != nil { return nil, fmt.Errorf("create 'container' contract client: %w", err) } @@ -68,12 +68,10 @@ func (c Client) ContractAddress() util.Uint160 { // parameter of Wrapper. type Option func(*opts) -type opts struct { - staticOpts []client.StaticClientOption -} +type opts []client.StaticClientOption func defaultOpts() *opts { - return &opts{staticOpts: []client.StaticClientOption{client.TryNotary()}} + return &opts{client.TryNotary()} } // AsAlphabet returns option to sign main TX @@ -83,6 +81,6 @@ func defaultOpts() *opts { // Considered to be used by IR nodes only. func AsAlphabet() Option { return func(o *opts) { - o.staticOpts = append(o.staticOpts, client.AsAlphabet()) + *o = append(*o, client.AsAlphabet()) } }