[#837] morph: Add WithSingleClient client constructor option

`WithSingleClient` allows Morph client
creation with existing raw neo-go client.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-09-21 17:30:45 +03:00 committed by Alex Vanin
parent 264ab489bb
commit 5e74830c38
4 changed files with 74 additions and 26 deletions

View file

@ -54,6 +54,16 @@ type singleClient struct {
notary *notary
}
func blankSingleClient(cli *client.Client, w *wallet.Account, cfg *cfg) *singleClient {
return &singleClient{
logger: cfg.logger,
client: cli,
acc: w,
waitInterval: cfg.waitInterval,
signer: cfg.signer,
}
}
// ErrNilClient is returned by functions that expect
// a non-nil Client pointer, but received nil.
var ErrNilClient = errors.New("client is nil")