From 111bb1b6c767a6f9654dde1a711d1db784f0770a Mon Sep 17 00:00:00 2001 From: alvarius Date: Mon, 30 Sep 2024 21:51:15 +0100 Subject: [PATCH] fix(cli): update state block in dev runner redeploy (#3243) --- .changeset/kind-kangaroos-leave.md | 5 +++++ packages/cli/src/deploy/getWorldDeploy.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/kind-kangaroos-leave.md diff --git a/.changeset/kind-kangaroos-leave.md b/.changeset/kind-kangaroos-leave.md new file mode 100644 index 0000000000..a3e00c7a9e --- /dev/null +++ b/.changeset/kind-kangaroos-leave.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +Fixed a dev runner bug where the state block of a previous deploy was not updated during a redeploy, causing failed deploys due to fetching outdated world state. diff --git a/packages/cli/src/deploy/getWorldDeploy.ts b/packages/cli/src/deploy/getWorldDeploy.ts index af860f2b2f..86982740ff 100644 --- a/packages/cli/src/deploy/getWorldDeploy.ts +++ b/packages/cli/src/deploy/getWorldDeploy.ts @@ -12,7 +12,10 @@ export async function getWorldDeploy(client: Client, worldAddress: Address): Pro let deploy = deploys.get(address); if (deploy != null) { - return deploy; + return { + ...deploy, + stateBlock: (await getBlock(client, { blockTag: "latest" })).number, + }; } debug("looking up world deploy for", address);