Fix multisig signed instruction formatting on explorer (#12439)

This commit is contained in:
Justin Starry 2020-09-24 13:17:14 +08:00 committed by GitHub
parent 731a943239
commit 59197fb368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -132,6 +132,24 @@ function TokenInstruction(props: InfoProps) {
let value = props.info[key];
if (value === undefined) continue;
// Flatten lists of public keys
if (Array.isArray(value) && value.every((v) => v instanceof PublicKey)) {
for (let i = 0; i < value.length; i++) {
let publicKey = value[i];
let label = `${key.charAt(0).toUpperCase() + key.slice(1)} - #${i + 1}`;
attributes.push(
<tr key={key + i}>
<td>{label}</td>
<td className="text-lg-right">
<Address pubkey={publicKey} alignRight link />
</td>
</tr>
);
}
continue;
}
if (key === "tokenAmount") {
key = "amount";
value = (value as TokenAmountUi).amount;