fix: coerce partially decoded instructions on parsed confirmed transactions (#13979)
* feat: coerce partially decoded instructions on parsed confirmed transactions * fix: flow tests * fix: need to check this again
This commit is contained in:
@@ -368,14 +368,9 @@ const SimulatedTransactionResponseValidator = jsonRpcResultAndContext(
|
||||
}),
|
||||
);
|
||||
|
||||
type PartiallyDecodedInnerInstruction = {
|
||||
index: number,
|
||||
instructions: PartiallyDecodedInstruction[],
|
||||
};
|
||||
|
||||
type ParsedInnerInstruction = {
|
||||
index: number,
|
||||
instructions: (ParsedInstruction | PartiallyDecodedInnerInstruction)[],
|
||||
instructions: (ParsedInstruction | PartiallyDecodedInstruction)[],
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2602,6 +2597,18 @@ export class Connection {
|
||||
assert(typeof result !== 'undefined');
|
||||
if (result === null) return result;
|
||||
|
||||
if (result.meta.innerInstructions) {
|
||||
result.meta.innerInstructions.forEach(inner => {
|
||||
inner.instructions.forEach(ix => {
|
||||
ix.programId = new PublicKey(ix.programId);
|
||||
|
||||
if (ix.accounts) {
|
||||
ix.accounts = ix.accounts.map(account => new PublicKey(account));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const {
|
||||
accountKeys,
|
||||
instructions,
|
||||
|
Reference in New Issue
Block a user