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

the contract methods call function mutates its options argument #5304

Closed
1 task done
karmaniverous opened this issue Aug 1, 2022 · 1 comment · Fixed by #5394
Closed
1 task done

the contract methods call function mutates its options argument #5304

karmaniverous opened this issue Aug 1, 2022 · 1 comment · Fixed by #5394
Assignees
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@karmaniverous
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

A simple options argument passed to the call function acquires new keys.

{ from: '0xD28D1f59...' }

becomes

{
  from: '0xd28d1f59...',
  data: '0x5e615a6b',
  gasPrice: undefined,
  gas: undefined,
  to: '0xb97da33a...'
}

after the call.

Expected Behavior

This function shouldn't mutate its configuration arguments. This cause problems when you want to reuse them elsewhere.

Steps to Reproduce

See my writeup at https://karmanivero.us/blog/unexpected-mutations/

Web3.js Version

1.7.4

Environment

  • Operating System: Windows
  • Browser: Chrome (but this is happening on the back end)
  • Node.js Version: 18.2.0
  • NPM Version: 8.9.0

Anything Else?

No response

@spacesailor24
Copy link
Contributor

Thank you for reporting this issue to us, apologies it took so long - we've been working on the 4.x rewrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants