Skip to content

Commit 7af474f

Browse files
authored
Merge pull request #478 from hack-a-chain-software/feat/missing-code-return
feat: add optional code field to TransactionSummary
2 parents 014826a + 5127dbb commit 7af474f

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

indexer/src/kadena-server/config/graphql-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,7 @@ export type TransactionSummary = {
14111411
badResult?: Maybe<Scalars['String']['output']>;
14121412
canonical: Scalars['Boolean']['output'];
14131413
chainId: Scalars['BigInt']['output'];
1414+
code?: Maybe<Scalars['String']['output']>;
14141415
creationTime: Scalars['DateTime']['output'];
14151416
gas: Scalars['String']['output'];
14161417
gasLimit: Scalars['String']['output'];
@@ -3691,6 +3692,7 @@ export type TransactionSummaryResolvers<
36913692
badResult?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
36923693
canonical?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
36933694
chainId?: Resolver<ResolversTypes['BigInt'], ParentType, ContextType>;
3695+
code?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
36943696
creationTime?: Resolver<ResolversTypes['DateTime'], ParentType, ContextType>;
36953697
gas?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
36963698
gasLimit?: Resolver<ResolversTypes['String'], ParentType, ContextType>;

indexer/src/kadena-server/config/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ type TransactionSummary {
469469
gas: String!
470470
gasLimit: String!
471471
gasPrice: String!
472+
code: String
472473
}
473474

474475
"""

indexer/src/kadena-server/repository/application/transaction-repository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export type TransactionByPactCodeOutput = {
122122
gas: string;
123123
gasLimit: string;
124124
gasPrice: string;
125+
code?: string | null;
125126
};
126127

127128
/**

indexer/src/kadena-server/repository/infra/query-builders/transaction-query-builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ export default class TransactionQueryBuilder {
439439
td.gas AS "gas",
440440
td.gaslimit AS "gasLimit",
441441
td.gasprice AS "gasPrice",
442+
td.code AS code,
442443
t.result AS "result",
443444
b.height AS "height",
444445
b.canonical AS "canonical"

indexer/src/kadena-server/repository/infra/schema-validator/transaction-summary-schema-validator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const schema = z.object({
1212
gas: z.string(),
1313
gasLimit: z.string(),
1414
gasPrice: z.string(),
15+
code: z.any().nullable(),
1516
});
1617

1718
function validate(row: any): TransactionByPactCodeOutput {
@@ -28,6 +29,7 @@ function validate(row: any): TransactionByPactCodeOutput {
2829
gas: res.gas,
2930
gasLimit: res.gasLimit,
3031
gasPrice: res.gasPrice,
32+
code: res.code ? JSON.stringify(res.code) : null,
3133
};
3234
}
3335

indexer/tests/integration/builders/transactions-by-pact-code.builders.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const getTransactionsByPactCodeQuery = (params: any): string => {
3030
gasLimit
3131
gasPrice
3232
sender
33+
code
3334
}
3435
}
3536
}

0 commit comments

Comments
 (0)