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(create-mud): use new sync packages #1214

Merged
merged 83 commits into from
Aug 9, 2023
Merged

Conversation

holic
Copy link
Member

@holic holic commented Jul 31, 2023

Updates all templates to use new sync packages

Waiting on wevm/viem#963 so we don't need zero-fee overrides everywhere

@changeset-bot
Copy link

changeset-bot bot commented Jul 31, 2023

🦋 Changeset detected

Latest commit: d4984cc

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

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

Comment on lines +21 to +30
2. In your `supportedChains.ts`, replace `foundry` chain with our new `mudFoundry` chain.

```diff
- import { foundry } from "viem/chains";
- import { MUDChain, latticeTestnet } from "@latticexyz/common/chains";
+ import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains";

- export const supportedChains: MUDChain[] = [foundry, latticeTestnet];
+ export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet];
```
Copy link
Member

Choose a reason for hiding this comment

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

is this part still necessary? or do we want to keep it so we can add stuff to mudFoundry in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's worth keeping for now since we've discovered a couple reasons to hook into viem internals

Copy link
Member Author

Choose a reason for hiding this comment

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

a reason to keep it: wevm/viem#1006

Comment on lines +42 to +43
- : world?.blockNumber ?? -1; // -1 will attempt to find the block number from RPC
+ : world?.blockNumber ?? 0n;
Copy link
Member

Choose a reason for hiding this comment

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

do we currently have some mechanism to look for the HelloWorld event? or load it from the worlds.json file?

Copy link
Member

Choose a reason for hiding this comment

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

nvm world?.blockNumber already grabs it from the worlds.json

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.

I am imagining in the future syncToRecs will attempt to find a HelloStore event emission (which will also have things like protocol version)

Co-authored-by: alvarius <alvarius@lattice.xyz>
Copy link
Member

Choose a reason for hiding this comment

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

big props on this changeset, this is by far the best changeset we have so far

Comment on lines +49 to +56
// KeysWithValue doesn't seem to like singleton keys
// modules: [
// {
// name: "KeysWithValueModule",
// root: true,
// args: [resolveTableId("CounterTable")],
// },
// ],
Copy link
Member

Choose a reason for hiding this comment

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

will be solved by #1125

Copy link
Member

@alvrs alvrs left a comment

Choose a reason for hiding this comment

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

LFG 🎉

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