[#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

@ -36,15 +36,11 @@ func (x *multiClient) createForAddress(addr string) (*Client, error) {
return nil, err
}
sCli := blankSingleClient(cli, x.account, &x.cfg)
sCli.notary = x.sharedNotary
c := &Client{
singleClient: &singleClient{
logger: x.cfg.logger,
client: cli,
acc: x.account,
waitInterval: x.cfg.waitInterval,
signer: x.cfg.signer,
notary: x.sharedNotary,
},
singleClient: sCli,
}
x.clients[addr] = c