[testnet][web] separate Client from RunningClient to support early calls to ad…#5916
[testnet][web] separate Client from RunningClient to support early calls to ad…#5916ma2bd wants to merge 3 commits into
Conversation
| const owner = signer.address(); | ||
| const chainId = await faucet.claimChain(wallet, owner); | ||
| const client = await new linera.Client(wallet, signer); | ||
| const client = await (await new linera.Client(wallet, signer)).start(); |
There was a problem hiding this comment.
While maintaining the Client/RunningClient distinction in the statics on the Rust side is nice, I'm not sure about exposing it to JavaScript where the original object is still accessible. If anything I think a more idiomatic pattern might be for start() to return an object representing the additional capabilities.
| Some(e) => Error::from(e), | ||
| None => Error::new("chain listener error (details unavailable)"), |
|
|
||
| if let Err(Some(e)) = self.chain_listener_result.await.map_err(Rc::into_inner) { | ||
| return Err(e.into()); | ||
| if let Err(e) = self.chain_listener_handle.await { |
There was a problem hiding this comment.
I'm a bit confused about this: the Storage is carefully threaded all the way back from the chain listener task in linera-client, but then here it's dropped on the floor — maybe a rebase artifact? We assume the storage is Clone everywhere right now, so I'm not sure what the motivation would be for wanting this particular copy of it.
|
closing in favor of #5937 |
Motivation
support early calls to add chain owners
Proposal
ClientfromRunningClientClientsupportsadd_ownerandstartRunningClientsupportsstopTest Plan
CI