[#1538] morph/container: Make opts struct similar to that of other contracts
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 3m42s
DCO action / DCO (pull_request) Successful in 4m23s
Vulncheck / Vulncheck (pull_request) Successful in 5m24s
Build / Build Components (pull_request) Successful in 5m59s
Tests and linters / Staticcheck (pull_request) Successful in 5m58s
Tests and linters / gopls check (pull_request) Successful in 6m3s
Pre-commit hooks / Pre-commit (pull_request) Successful in 6m13s
Tests and linters / Tests with -race (pull_request) Successful in 6m13s
Tests and linters / Lint (pull_request) Successful in 6m19s
Tests and linters / Tests (pull_request) Successful in 7m43s
Tests and linters / Run gofumpt (push) Successful in 2m13s
Vulncheck / Vulncheck (push) Successful in 2m50s
Tests and linters / Staticcheck (push) Successful in 3m0s
Build / Build Components (push) Successful in 3m36s
Pre-commit hooks / Pre-commit (push) Successful in 3m40s
Tests and linters / gopls check (push) Successful in 4m16s
Tests and linters / Lint (push) Successful in 4m27s
Tests and linters / Tests (push) Successful in 4m31s
Tests and linters / Tests with -race (push) Successful in 5m26s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-04 15:28:33 +03:00
parent 6a51086030
commit 84b4051b4d
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -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())
}
}