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

feat: isRiscV check function #1878

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

peetzweg
Copy link
Contributor

@peetzweg peetzweg commented Sep 6, 2023

Introduced in originally in this PR polkadot-js/api#5699 (review) , it was suggested to be moved to the @polkadot/common package.

I've basically just copied over the code form the pr in the api package. The isWasm and isRiscV function signature differs as the isWasm's parameter of bytes is optional. Should we align both functions to have a optional or required parameter?

https://github.com/peetzweg/common/blob/d8a4d018f18fe69f2ad796d986ff950335cb2b35/packages/util/src/is/riscv.ts#L15-L17

https://github.com/peetzweg/common/blob/d8a4d018f18fe69f2ad796d986ff950335cb2b35/packages/util/src/is/wasm.ts#L15-L17

@peetzweg peetzweg changed the title feat: isRiscV guard function feat: isRiscV check function Sep 6, 2023
@jacogr
Copy link
Member

jacogr commented Sep 6, 2023

I think it is fine as-is - unknown also caters for undefined. (So isWasm seems to go a bit overboard in this case - I think this is the case with a lot of functions, where ? is not strictly required...)

Copy link
Member

@jacogr jacogr left a comment

Choose a reason for hiding this comment

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

Thank you.

@jacogr jacogr merged commit b018f78 into polkadot-js:master Sep 6, 2023
4 checks passed
@polkadot-js-bot
Copy link

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.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants