Make options for `.signAsync` optional
See original GitHub issueGoal:
Update signAsync
to make the second argument optional, and default to {}
Background:
Currently this code will crash:
const signed = await api.system.remark().signAsync(pair, options);
when options
is undefined
, it gives this error
(node:78914) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'nonce' of undefined
at Submittable.value (/Users/xiliangchen/projects/playground/node_modules/@polkadot/api/submittable/createClass.js:59:42)
at Submittable.value (/Users/xiliangchen/projects/playground/node_modules/@polkadot/api/submittable/createClass.js:129:99)
at /Users/xiliangchen/projects/playground/node_modules/@polkadot/api/submittable/createClass.js:251:110
at /Users/xiliangchen/projects/playground/node_modules/@polkadot/api/promise/Api.js:78:14
at Submittable.signAsync (/Users/xiliangchen/projects/playground/node_modules/@polkadot/api/submittable/createClass.js:251:170)
at /Users/xiliangchen/projects/playground/index.ts:28:33
at step (/Users/xiliangchen/projects/playground/index.ts:33:23)
at Object.next (/Users/xiliangchen/projects/playground/index.ts:14:53)
at /Users/xiliangchen/projects/playground/index.ts:8:71
at new Promise (<anonymous>)
Actions:
Make second argument optional
Update interface
Provide appropriate unit tests.
@jacogr please tag this if you are happy about this.
Tags:
bounty-awaiting-approval
bounty-XS
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Options Summary (GNU make) - GNU.org
Here is a table of all the options make understands: ... This option is useful if you need to use an older versions...
Read more >Setting optional values using NDesk.Options - Stack Overflow
Using the accepted answer in Best way to parse command line arguments in C#? as your example, how can I make the 'r'...
Read more >Handling Optional Arguments in bash - Unix Stack Exchange
I have the following function that is supposed to write strings in new lines. There is a warning option, so that when -w...
Read more >std/options
This module implements types which encapsulate an optional value. ... import std/options proc find(haystack: string, needle: char): Option[int] = for i, ...
Read more >Options Summary - GNU `make'
GNU `make' ... GNU make proceeds to consider targets and their prerequisites using the normal ... The -d option is equivalent to `...
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
@developerfred as you’ve been asked on another issue this week, please do not start working before you’re approved for an issue.
Submitting a PR before you are approved is not only discourteous to other bounty hunters but possibly could waste time if the code in question isn’t up to par.
Please, in the future, do not start working on Pull Requests before you’re approved to start work, as it disrupts everyone’s time involved.
We’re happy to see your involvement and excitement to work on issues in the ecosystem and we’d love to have your contributions, but please follow the protocol before submitting any further pull requests.
Thanks, if you have any other questions feel free to reach out to me directly - chris@web3.foundation
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.