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

Fix: #2531 value types function overload #2560

Closed

Conversation

Yuripetusko
Copy link
Sponsor Contributor

@Yuripetusko Yuripetusko commented Jul 30, 2024

fixes #2531. Infer value type for function overload where some of the functions are payable and others arent. Using args to find the matching function from overload union, then picking it's value type

P.S. Not sure why it shows so many commits. Probably needed to cut a new branch from upstream 🤔


PR-Codex overview

This PR introduces changes related to estimating contract fees and gas, adding a new function mint, updating contract ABIs, and refining contract writing actions.

Detailed summary

  • Added mint function with payable state to contract ABIs
  • Updated GetValue function signatures to include mutability and args
  • Improved contract writing actions with additional parameters and data suffix
  • Updated test cases for GetValue function
  • Updated dependencies for viem package

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Yuripetusko and others added 14 commits January 13, 2024 19:42
Fixes this error

```
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/yuri/Sites/polkadot/viem/node_modules/is-plain-obj/index.js from /Users/yuri/Sites/polkadot/viem/node_modules/minimist-options/index.js not supported.
Instead change the require of /Users/yuri/Sites/polkadot/viem/node_modules/is-plain-obj/index.js in /Users/yuri/Sites/polkadot/viem/node_modules/minimist-options/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/yuri/Sites/polkadot/viem/node_modules/minimist-options/index.js:3:23)
    at Object.<anonymous> (/Users/yuri/Sites/polkadot/viem/node_modules/meow/index.js:3:28)
    at Object.<anonymous> (/Users/yuri/Sites/polkadot/viem/node_modules/@changesets/cli/dist/cli.cjs.dev.js:3:12)
    at Object.<anonymous> (/Users/yuri/Sites/polkadot/viem/node_modules/@changesets/cli/dist/cli.cjs.js:6:20)
    at Object.<anonymous> (/Users/yuri/Sites/polkadot/viem/node_modules/@changesets/cli/bin.js:4:1) {
  code: 'ERR_REQUIRE_ESM'
}
```
Copy link

changeset-bot bot commented Jul 30, 2024

⚠️ No Changeset found

Latest commit: 67de026

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jul 30, 2024

@Yuripetusko is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@Yuripetusko Yuripetusko changed the title Fixex #2531 value types function overload Fix: #2531 value types function overload Jul 30, 2024
Yuripetusko added a commit to Yuripetusko/viem that referenced this pull request Jul 30, 2024
@Yuripetusko Yuripetusko deleted the fix/2531-value-types-function-overload branch July 30, 2024 03:13
tmm added a commit that referenced this pull request Aug 6, 2024
* fixes #2560  value type on function overload

* Create new-hotels-sell.md

* revert GetValue changes and create new GetMutabilityAwareValue type

* remove un-used test

* revert test abi

* use mutability aware type util on writeContract too

* fix: wrong import

* lint

* fix import

* Update .changeset/new-hotels-sell.md

---------

Co-authored-by: Tom Meagher <[email protected]>
@github-actions github-actions bot mentioned this pull request Aug 6, 2024
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.

(simulate|write)Contract payable value not working for overloads
2 participants