WsProvider.subscribe does not always return a promise
See original GitHub issueWorkaround here - https://github.com/polkadot-js/api/blob/master/packages/rpc-core/src/index.ts#L199
To reproduce -
- Remove the wrapping
Promise.resolve
as linked - Run the
rpc-core/formatting
tests, the error will be logged
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to use the @polkadot/api.ApiPromise.create function in ...
The callback is fired when new headers // are found, the call itself returns a promise with a subscription that can be //...
Read more >Angular 2 Property subscribe does not exist on type Promise ...
subscribe method is for 'Observable', so you can just return an Observable Object. then do what you want to do like this
Read more >@polkadot/api WsProvider TypeScript Examples
This page shows TypeScript code examples of @polkadot/api WsProvider. ... isReady unfortunately doesn't wait for those properly await new Promise((resolve) ...
Read more >Using promises - JavaScript - MDN Web Docs
A Promise is an object representing the eventual completion or ... Important: Always return results, otherwise callbacks won't catch the ...
Read more >ApiPromise - Overview
As a full Promise-based, all interface calls return Promises, ... use is to be made of the subscription-based features of Polkadot (and Substrate)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It does pass yes, but it logs on the console.
So run with
yarn test:one ...
(botch scenarios - in the commented scenario the errors are displayed)This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.