-
Notifications
You must be signed in to change notification settings - Fork 352
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
Adds tests cases for issue #5702 #5703
Conversation
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.
Always appreciate this. Obviously it cannot be merged but useful for somebody that wishes to look into the logged issue - if CI fails the PR is not merge-able, but somebody can certainly copy this/parts of it into their effort.
One comment:
If anything fails you need to delve through an it statement to find the place - so each it
should have 1 expectation (maybe more, if they are very closely related and follow-ups of each other and easy to find)
In some cases it is possible, in others it would be impossible to find which one creates issues, for instance
// Zero
expect(
new Int(registry, new Uint8Array([0]), 8).toNumber()
).toEqual(0);
expect(
new Int(registry, new Uint8Array([0, 0]), 16).toNumber()
).toEqual(0);
TL;DR Rather use a describe
block with specific it
+ (one) expect
for each.
EDIT: If there are u8 -> number
issues, the underlying decoding problems would be in https://github.com/polkadot-js/common/blob/master/packages/util/src/u8a/toNumber.ts & https://github.com/polkadot-js/common/blob/master/packages/util/src/u8a/toBn.ts (which also has relevant tests, worth expanding)
Thanks @jacogr for pointing out where these errors might root from. Tried looking into it a bit already, will continue from there.
Yes, agree it's not as transparent which one failed, however the stacktrace reveals which one it actually failed i.e.
Copy pasting almost identical There also seems to be an issue with decoding just the value
Which is a quite odd. 🤔 |
I think I have found the cause for these inconsistencies, haven't been able resolve the problem yet. I have to hunches which look odd to me.
|
Could you merge in the master branch (it contains the latest common stuff). Hopefully it means the test cases here would start passing… |
@jacogr done! They succeed locally now. Great job! 🙌 |
Co-authored-by: Jaco <[email protected]>
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.
Thank you.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See #5702 for further details.