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

Improve formatParam to not mutate the input #4556

Closed
nazarhussain opened this issue Nov 18, 2021 · 2 comments
Closed

Improve formatParam to not mutate the input #4556

nazarhussain opened this issue Nov 18, 2021 · 2 comments
Assignees
Labels
4.x 4.0 related Enhancement Includes improvements or optimizations

Comments

@nazarhussain
Copy link
Contributor

Expected behavior

No input parameters should be mutated.

Actual behavior

Currently the formatParam function in web3-eth-abi package is mutating the input parameters. That can have side effects and may result in introducing bugs. Would be nice fix it.

https://github.com/ChainSafe/web3.js/blob/d9726d41babe14bc823d5d2ea4e4af15ef5914ac/packages/web3-eth-abi/src/utils.ts#L120

https://github.com/ChainSafe/web3.js/blob/a1c7d71973ec17f9287fbea8939e64a80e589fc6/packages/web3-eth-abi/src/index.js#L249

Environment

1.x, 4.x

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Jan 18, 2022
@mconnelly8 mconnelly8 added 4.x 4.0 related Enhancement Includes improvements or optimizations and removed Stale Has not received enough activity labels Jan 25, 2022
@mconnelly8
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

3 participants