Explorer: don't throw error for strange token instructions (#13268)

This commit is contained in:
Justin Starry
2020-10-29 13:17:35 +08:00
committed by GitHub
parent c458d4b213
commit ffeadd4e29

View File

@ -243,7 +243,7 @@ export function useMintAccountInfo(
const data = accountInfo?.data?.details?.data; const data = accountInfo?.data?.details?.data;
if (!data) return; if (!data) return;
if (data.program !== "spl-token" || data.parsed.type !== "mint") { if (data.program !== "spl-token" || data.parsed.type !== "mint") {
throw new Error("Expected mint"); return;
} }
return coerce(data.parsed.info, MintAccountInfo); return coerce(data.parsed.info, MintAccountInfo);
@ -263,7 +263,7 @@ export function useTokenAccountInfo(
const data = accountInfo?.data?.details?.data; const data = accountInfo?.data?.details?.data;
if (!data) return; if (!data) return;
if (data.program !== "spl-token" || data.parsed.type !== "account") { if (data.program !== "spl-token" || data.parsed.type !== "account") {
throw new Error("Expected token account"); return;
} }
return coerce(data.parsed.info, TokenAccountInfo); return coerce(data.parsed.info, TokenAccountInfo);