Skip to content

Commit 33bfe7a

Browse files
x3c41aclaude
andcommitted
fix: use System.Number instead of LastRuntimeUpgrade in waitForChainReady
System.LastRuntimeUpgrade doesn't exist in bulletin runtime's typed API Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent febf06b commit 33bfe7a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

examples/common.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,10 @@ export async function waitForChainReady(typedApi, maxRetries = 10, retryDelayMs
127127

128128
for (let attempt = 1; attempt <= maxRetries; attempt++) {
129129
try {
130-
// Try multiple queries to ensure chain is fully synced
131-
const [runtimeVersion, blockNumber] = await Promise.all([
132-
typedApi.query.System.LastRuntimeUpgrade(),
133-
typedApi.query.System.Number()
134-
]);
135-
130+
// Query block number to verify chain is synced and responsive
131+
const blockNumber = await typedApi.query.System.Number();
136132
const blockNum = blockNumber ?? 0;
137-
console.log(`✅ Chain is ready! Block #${blockNum}, Runtime: ${runtimeVersion ? 'available' : 'checking...'}`);
133+
console.log(`✅ Chain is ready! Block #${blockNum}`);
138134
return true;
139135
} catch (error) {
140136
if (attempt < maxRetries) {

0 commit comments

Comments
 (0)