-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support wasm #91
Support wasm #91
Conversation
src/swaps/liquid.rs
Outdated
let electrum_client = network_config.clone().build_client()?; | ||
pub async fn fetch_utxo<LC: LiquidClient, N: LiquidNetworkConfig<LC>>( | ||
&self, | ||
network_config: &N, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a config forces this function to call build_client
(and create a new client) which prevents from the caller to reuse a client implementation. In electrum we have seen it has a big performance penalty.
I know this was the implementation before this PR but perhaps if we are going for such a big change we can improve it?
I commented on this method as an example but this pattern repeats itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d4aee44
to
d7395ba
Compare
0366f4c
to
8ce332e
Compare
8ce332e
to
8aab73a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Added two NITs.
Co-authored-by: michael1011 <[email protected]>
There is an issue with the websocket client. I see two main solution paths:
|
I'd prefer a ping/pong JSON message in the application layer over having to fork |
I opened a PR on boltz-backend to add these ping/pong messages. |
In f48f3d5 I've adjusted the ws message structs to align with https://github.com/BoltzExchange/boltz-backend, including the newly added ping/pong messages. Added also regtest test for the pinging. This is ready for another review round. cc @michael1011 @i5hi @roeierez |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry about the delay in reviewing; closing up another release now and will take a look at this and test it tomorrow morning. |
Getting this error when I run the tests:
Similar error for : |
@i5hi Could you please try to run the same tests on I've opened an issue #93 for this. |
Yes, I had tested it on a mac. Tested on Linux and its all good. |
LGTM. Thanks @danielgranhao ! |
Resolves #90.
This PR:
ureq
to asyncreqwest
tungstenite
totokio-tungstenite-wasm
- as the name indicates, this crate usestokio-tungstenite
for native buildsThere are still some TODOs, but I would appreciate some initial feedback.TODO: