explorer: Add account bytes to tx inspector (#26200)

This commit is contained in:
Justin Starry 2022-06-24 11:40:30 +01:00 committed by GitHub
parent b26c79b77b
commit 8ef33a53a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -81,21 +81,21 @@ function AccountInfo({
const errorMessage = validator && validator(info.data); const errorMessage = validator && validator(info.data);
if (errorMessage) return <span className="text-warning">{errorMessage}</span>; if (errorMessage) return <span className="text-warning">{errorMessage}</span>;
if (info.data.details?.executable) { if (!info.data.details) {
return <span className="text-muted">Executable Program</span>; return <span className="text-muted">Account doesn't exist</span>;
} }
const owner = info.data.details?.owner; const owner = info.data.details.owner;
const ownerAddress = owner?.toBase58(); const ownerAddress = owner.toBase58();
const ownerLabel = ownerAddress && addressLabel(ownerAddress, cluster); const ownerLabel = addressLabel(ownerAddress, cluster);
return ( return (
<span className="text-muted"> <span className="text-muted">
{ownerAddress {`Owned by ${ownerLabel || ownerAddress}.`}
? `Owned by ${ {` Balance is ${lamportsToSolString(info.data.lamports)} SOL.`}
ownerLabel || ownerAddress {` Size is ${new Intl.NumberFormat("en-US").format(
}. Balance is ${lamportsToSolString(info.data.lamports)} SOL` info.data.details.space
: "Account doesn't exist"} )} byte(s).`}
</span> </span>
); );
} }