[explorer] Fix parsing of some Pyth transactions. (#29943)

Fix a couple of bugs
This commit is contained in:
guibescos 2023-01-30 21:23:12 -06:00 committed by GitHub
parent 005dc96bc5
commit c606d9b167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import InitMappingDetailsCard from "./InitMappingDetailsCard";
import AddMappingDetailsCard from "./AddMappingDetailsCard"; import AddMappingDetailsCard from "./AddMappingDetailsCard";
import AggregatePriceDetailsCard from "./AggregatePriceDetailsCard"; import AggregatePriceDetailsCard from "./AggregatePriceDetailsCard";
import InitPriceDetailsCard from "./InitPriceDetailsCard"; import InitPriceDetailsCard from "./InitPriceDetailsCard";
import SetMinPublishersDetailsCard from "./SetMinPublishersDetailsCard";
export function PythDetailsCard(props: { export function PythDetailsCard(props: {
ix: TransactionInstruction; ix: TransactionInstruction;
@ -109,6 +110,13 @@ export function PythDetailsCard(props: {
{...props} {...props}
/> />
); );
case "SetMinPublishers":
return (
<SetMinPublishersDetailsCard
info={PythInstruction.decodeSetMinPublishers(ix)}
{...props}
/>
);
} }
} catch (error) { } catch (error) {
reportError(error, { reportError(error, {

View File

@ -402,7 +402,7 @@ export class PythInstruction {
return { return {
signerPubkey: instruction.keys[0].pubkey, signerPubkey: instruction.keys[0].pubkey,
pricePubkey: instruction.keys[1].pubkey, pricePubkey: instruction.keys[1].pubkey,
publisherPubkey: PublicKey.decode(publisherPubkey), publisherPubkey: new PublicKey(publisherPubkey),
}; };
} }
@ -420,7 +420,7 @@ export class PythInstruction {
return { return {
signerPubkey: instruction.keys[0].pubkey, signerPubkey: instruction.keys[0].pubkey,
pricePubkey: instruction.keys[1].pubkey, pricePubkey: instruction.keys[1].pubkey,
publisherPubkey: PublicKey.decode(publisherPubkey), publisherPubkey: new PublicKey(publisherPubkey),
}; };
} }