[#496] Use single contract wrapper constructor

There is no need in a separate `New()` or `WrapClient()`

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-05-21 14:02:46 +03:00 committed by Alex Vanin
parent b52751e992
commit 2b2b2c2c45
11 changed files with 12 additions and 121 deletions

View file

@ -13,11 +13,6 @@ import (
// client which implements storage of reputation values.
type ClientWrapper reputation.Client
// WrapClient wraps reputation contract client and returns ClientWrapper instance.
func WrapClient(c *reputation.Client) *ClientWrapper {
return (*ClientWrapper)(c)
}
// NewFromMorph returns the wrapper instance from the raw morph client.
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*ClientWrapper, error) {
staticClient, err := client.NewStatic(cli, contract, fee)
@ -30,5 +25,5 @@ func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8)
return nil, fmt.Errorf("could not create reputation contract client: %w", err)
}
return WrapClient(enhancedRepurationClient), nil
return (*ClientWrapper)(enhancedRepurationClient), nil
}