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

Prevent ABI objects from being mutated #3818

Merged
merged 4 commits into from Jan 5, 2021
Merged

Conversation

haltman-at
Copy link
Contributor

@haltman-at haltman-at commented Dec 16, 2020

Description

Fixes #3748. Prevents ABI parameter objects from being changed when used as inputs to encoding/decoding functions. Does this by replacing t.type = "bytes24" with t = Object.assign({}, t, { type: "bytes24" }).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

@haltman-at
Copy link
Contributor Author

haltman-at commented Dec 16, 2020

I had trouble completing some of the checklist on my machine (and am still running some of it which I'll check off later), but since this is so simple I hope that's OK.

@haltman-at
Copy link
Contributor Author

Btw tagging @cgewecke and @GregTheGreek to make sure you two see this. :)

@coveralls
Copy link

coveralls commented Dec 16, 2020

Coverage Status

Coverage decreased (-2.4%) to 78.034% when pulling fd717ba on haltman-at:no-mutate into 4469516 on ethereum:1.x.

@GregTheGreek
Copy link
Contributor

@spacesailor24 cant seem to assign you...

@GregTheGreek GregTheGreek merged commit e02374e into web3:1.x Jan 5, 2021
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.

ABI objects passed into web3 functions may end up mutated
4 participants