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

chore: update web3 to v1.10.0 and prettier to v3 #301

Merged
merged 2 commits into from
Aug 1, 2023
Merged

Conversation

Hugoo
Copy link
Contributor

@Hugoo Hugoo commented Aug 1, 2023

No description provided.

@Hugoo Hugoo changed the title chore: update web3 to 1.10.0 chore: update web3 to 1.10.0 and prettier to v3 Aug 1, 2023
@Hugoo Hugoo changed the title chore: update web3 to 1.10.0 and prettier to v3 chore: update web3 to v1.10.0 and prettier to v3 Aug 1, 2023
"web3-providers-http": "^1.8.0",
"web3-utils": "^1.8.2"
"web3-eth-abi": "^1.10.0",
"web3-providers-http": "^1.10.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! There were some improvements in this release

https://github.com/web3/web3.js/releases/tag/v1.10.0

image

@@ -430,7 +430,7 @@ export class ERC725 {
static encodePermissions(permissions: Permissions): string {
const result = Object.keys(permissions).reduce((previous, key) => {
return permissions[key]
? previous + hexToNumber(LSP6_DEFAULT_PERMISSIONS[key])
? previous + Number(hexToNumber(LSP6_DEFAULT_PERMISSIONS[key]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this casting necessary? Doesn't the function hexToNumber convert to a Number already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type has changed in v1.9.0 -> https://github.com/web3/web3.js/releases/tag/v1.9.0

utils.toNumber and utils.hexToNumber can now return the large unsafe numbers as BigInt, if true was passed to a new optional parameter called bigIntOnOverflow (web3/web3.js#5845)

We dont call it with true so it should not output a BigInt, but still the TS type thinks it is Number or string. This is to limit to Number only (which should be the truth)

@Hugoo Hugoo merged commit a168de2 into develop Aug 1, 2023
2 checks passed
@Hugoo Hugoo deleted the update-dep5 branch August 1, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants