From 255c1c8d3dd7ce39977dbd02535234b38033aa77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ti=E1=BA=BFn=20Nguy=E1=BB=85n=20Kh=E1=BA=AFc?= Date: Wed, 21 Aug 2024 01:46:17 +1200 Subject: [PATCH] fix: incorrect atom type when querying with block hash (#129) --- .changeset/rude-eels-yawn.md | 5 +++++ packages/core/src/actions/query.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/rude-eels-yawn.md diff --git a/.changeset/rude-eels-yawn.md b/.changeset/rude-eels-yawn.md new file mode 100644 index 00000000..bca7e24c --- /dev/null +++ b/.changeset/rude-eels-yawn.md @@ -0,0 +1,5 @@ +--- +"@reactive-dot/core": patch +--- + +Fixed incorrect atom type when querying with block hash. diff --git a/packages/core/src/actions/query.ts b/packages/core/src/actions/query.ts index ff90dd8c..200e297b 100644 --- a/packages/core/src/actions/query.ts +++ b/packages/core/src/actions/query.ts @@ -18,6 +18,10 @@ export function preflight( ? "observable" : "promise" | "observable"; + if ("at" in instruction && instruction.at?.startsWith("0x")) { + return "promise" as Return; + } + switch (instruction.instruction) { case "get-constant": case "call-api":