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(common): add createContract, createNonceManager utils #1261

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

holic
Copy link
Member

@holic holic commented Aug 9, 2023

pulled out of #1214

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2023

🦋 Changeset detected

Latest commit: 67c2d6c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@latticexyz/common Major
@latticexyz/block-logs-stream Major
@latticexyz/cli Major
@latticexyz/config Major
@latticexyz/dev-tools Major
@latticexyz/network Major
@latticexyz/protocol-parser Major
@latticexyz/std-client Major
@latticexyz/store-cache Major
@latticexyz/store-indexer Major
@latticexyz/store-sync Major
@latticexyz/store Major
@latticexyz/utils Major
@latticexyz/world Major
@latticexyz/ecs-browser Major
@latticexyz/react Major
@latticexyz/phaserx Major
@latticexyz/recs Major
create-mud Major
@latticexyz/gas-report Major
@latticexyz/noise Major
@latticexyz/schema-type Major
@latticexyz/services Major
@latticexyz/solecs Major
solhint-config-mud Major
solhint-plugin-mud Major
@latticexyz/std-contracts Major

Not sure what this means? Click here to learn what changesets are.

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

@holic holic marked this pull request as ready for review August 9, 2023 12:05
@holic holic requested a review from alvrs as a code owner August 9, 2023 12:05
const debug = parentDebug.extend("createContract");

// copied from viem because it isn't exported
// TODO: import from viem?
Copy link
Member

Choose a reason for hiding this comment

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

should we open a viem issue for this?

Copy link
Member Author

@holic holic Aug 9, 2023

Choose a reason for hiding this comment

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

image

🤷‍♂️

hopefully they'll have some better hooks for us for nonce handling

throw error;
},
}),
{ throwOnTimeout: true }
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't have a timeout configured but queue.add has a Promise<T | void> return type unless you toggle this on

}

debug("simulating write", functionName, args, options);
const { request } = await publicClient.simulateContract({
Copy link
Member

Choose a reason for hiding this comment

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

so the request include the estimated gas limit correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep!

@holic holic merged commit cd5abcc into main Aug 9, 2023
@holic holic deleted the holic/mud-viem-utils branch August 9, 2023 12:59
@github-actions github-actions bot mentioned this pull request Aug 9, 2023
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.

2 participants