Skip to content
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

Various WASM client updates #1489

Merged
merged 7 commits into from
Mar 24, 2023
Merged

Various WASM client updates #1489

merged 7 commits into from
Mar 24, 2023

Conversation

sisou
Copy link
Member

@sisou sisou commented Mar 23, 2023

What's in this pull request?

  • Fix PlainBlock generated Typescript types, which were invalid before
  • Make all client methods async, like they have been in the 1.0 client and to be consistent (because the tx listener method must be async as it does network requests to subscribe at peers)
  • Implement getAccount and getAccounts methods on the client (enabled by Create the accounts proof request #1408 & Allow to prove the non-existence of keys #1484)
  • Implement transaction listeners by subscribing to addresses (enabled by Tx events subscription #1437)
  • Add serialize method to Address for compatibility
  • Avoid concurrent access locks by avoiding any &mut self methods
  • Prevent addTransactionListener from failing when called without peers

This relates to #1339.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

@sisou sisou added the WASM label Mar 23, 2023
@sisou sisou self-assigned this Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 0.31% and project coverage change: -0.33 ⚠️

Comparison is base (ce641a9) 65.28% compared to head (81bb56d) 64.95%.

Additional details and impacted files
@@              Coverage Diff              @@
##           albatross    #1489      +/-   ##
=============================================
- Coverage      65.28%   64.95%   -0.33%     
=============================================
  Files            424      425       +1     
  Lines          52121    52376     +255     
=============================================
- Hits           34027    34021       -6     
- Misses         18094    18355     +261     
Flag Coverage Δ
unittests 64.95% <0.31%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web-client/src/account.rs 0.00% <0.00%> (ø)
web-client/src/address.rs 0.00% <0.00%> (ø)
web-client/src/block.rs 0.00% <0.00%> (ø)
web-client/src/lib.rs 0.14% <0.00%> (-0.06%) ⬇️
consensus/src/consensus/consensus_proxy.rs 46.70% <100.00%> (ø)

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jsdanielh
Copy link
Member

Rebasing it to get it merged

sisou added 7 commits March 23, 2023 16:21
To be consistent with 1.0 client and across all methods, as the upcoming add_transaction_listener method will have to be async.
Because the API is mostly async, two async methods of which one takes `&mut self` and the other takes `&self` cannot be called at the same time. This prevents adding event listeners while waiting for waitForConsensusEstablished for example.
…urned

Even when no peers accepted the subscription.
@jsdanielh jsdanielh force-pushed the soeren/wasm-various branch from 25c1b25 to 81bb56d Compare March 23, 2023 22:22
@jsdanielh jsdanielh merged commit 81bb56d into albatross Mar 24, 2023
@jsdanielh jsdanielh deleted the soeren/wasm-various branch March 24, 2023 00:35
@jsdanielh jsdanielh added this to the Nimiq PoS Testnet milestone Apr 20, 2023
@sisou sisou added the pow-compatibility Changes that ensure components are compatible with the PoW JS implementation. label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pow-compatibility Changes that ensure components are compatible with the PoW JS implementation. WASM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants