Skip to content

Commit

Permalink
fix: broken inner instruction struct validator (#13231)
Browse files Browse the repository at this point in the history
* add-inner-trx

* add compiled instructions

* remove type parsed inner instruction mistake

* add fix import & struct union for InnerInstruction

* import type connection

Co-authored-by: Viacheslav Tsurka <vt@parity.digital>
  • Loading branch information
vtsurka and Viacheslav Tsurka committed Oct 28, 2020
1 parent 2877310 commit ef80b3f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type {Blockhash} from './blockhash';
import type {FeeCalculator} from './fee-calculator';
import type {Account} from './account';
import type {TransactionSignature} from './transaction';
import type {CompiledInstruction} from './message';
import {AgentManager} from './agent-manager';

export const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;
Expand Down Expand Up @@ -1163,7 +1164,7 @@ const ConfirmedTransactionMetaResult = struct.union([
struct.pick({
err: TransactionErrorResult,
fee: 'number',
innerInstructions: struct.union(
innerInstructions: struct.union([
struct.array([
struct({
index: 'number',
Expand All @@ -1178,7 +1179,7 @@ const ConfirmedTransactionMetaResult = struct.union([
]),
'null',
'undefined',
),
]),
preBalances: struct.array(['number']),
postBalances: struct.array(['number']),
logMessages: struct.union([struct.array(['string']), 'null', 'undefined']),
Expand All @@ -1192,7 +1193,7 @@ const ParsedConfirmedTransactionMetaResult = struct.union([
struct.pick({
err: TransactionErrorResult,
fee: 'number',
innerInstructions: struct.union(
innerInstructions: struct.union([
struct.array([
struct({
index: 'number',
Expand All @@ -1214,7 +1215,7 @@ const ParsedConfirmedTransactionMetaResult = struct.union([
]),
'null',
'undefined',
),
]),
preBalances: struct.array(['number']),
postBalances: struct.array(['number']),
logMessages: struct.union([struct.array(['string']), 'null', 'undefined']),
Expand Down

0 comments on commit ef80b3f

Please sign in to comment.