forked from TrueCloudLab/frostfs-node
[#1538] morph/container: Make opts struct similar to that of other contracts
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
6a51086030
commit
84b4051b4d
1 changed files with 4 additions and 6 deletions
|
@ -46,7 +46,7 @@ func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8,
|
||||||
opts[i](o)
|
opts[i](o)
|
||||||
}
|
}
|
||||||
|
|
||||||
sc, err := client.NewStatic(cli, contract, fee, o.staticOpts...)
|
sc, err := client.NewStatic(cli, contract, fee, *o...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("create 'container' contract client: %w", err)
|
return nil, fmt.Errorf("create 'container' contract client: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -68,12 +68,10 @@ func (c Client) ContractAddress() util.Uint160 {
|
||||||
// parameter of Wrapper.
|
// parameter of Wrapper.
|
||||||
type Option func(*opts)
|
type Option func(*opts)
|
||||||
|
|
||||||
type opts struct {
|
type opts []client.StaticClientOption
|
||||||
staticOpts []client.StaticClientOption
|
|
||||||
}
|
|
||||||
|
|
||||||
func defaultOpts() *opts {
|
func defaultOpts() *opts {
|
||||||
return &opts{staticOpts: []client.StaticClientOption{client.TryNotary()}}
|
return &opts{client.TryNotary()}
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsAlphabet returns option to sign main TX
|
// AsAlphabet returns option to sign main TX
|
||||||
|
@ -83,6 +81,6 @@ func defaultOpts() *opts {
|
||||||
// Considered to be used by IR nodes only.
|
// Considered to be used by IR nodes only.
|
||||||
func AsAlphabet() Option {
|
func AsAlphabet() Option {
|
||||||
return func(o *opts) {
|
return func(o *opts) {
|
||||||
o.staticOpts = append(o.staticOpts, client.AsAlphabet())
|
*o = append(*o, client.AsAlphabet())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue