Skip to content

Commit

Permalink
fix: fetch metadata for 3DPass (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKheops authored Jan 3, 2025
1 parent fc6982e commit baec22a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/extension-core/src/util/getMetadataDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,12 @@ export const getLatestMetadataRpc = async (

return metadataFromOpaque(opaqueMetadata)
} catch (err) {
// maybe the chain doesn't have metadata_versions or metadata_at_version runtime calls - ex: crust standalone
// fetch metadata the old way
if ((err as { message?: string })?.message?.includes("is not found"))
return await getLegacyMetadataRpc(chainId, blockHash)
const message = (err as { message?: string })?.message
if (
message?.includes("is not found") || // crust standalone
message?.includes("Module doesn't have export Metadata_metadata_versions") // 3DPass
)
return await getLegacyMetadataRpc(chainId, blockHash) // fetch metadata the old way

// eslint-disable-next-line no-console
console.error("getLatestMetadataRpc", { err })
Expand Down

0 comments on commit baec22a

Please sign in to comment.