Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Oct 22, 2024
1 parent 3f9264d commit ddd8b27
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/blockchain/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ export function createEvent(
export function createAction(
accountUpdateId: string,
data: string[],
transactionInfo: TransactionInfo
transactionInfo: TransactionInfo,
sequenceNumber: number,
zkappAccountUpdateIds: number[],
zkappEventElementIds: number[]
): Action {
return {
accountUpdateId,
data,
transactionInfo,
sequenceNumber,
zkappAccountUpdateIds,
zkappEventElementIds,
};
}
2 changes: 1 addition & 1 deletion src/db/sql/events-actions/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function emittedZkAppCommandsCTE(db_client: postgres.Sql) {
SELECT
blocks_accessed.*,
zkcu.id AS zkapp_account_update_id,
bzkc.sequence_no,
bzkc.sequence_no AS sequence_number,
zkapp_fee_payer_body_id,
zkapp_account_updates_ids,
authorization_kind,
Expand Down
3 changes: 3 additions & 0 deletions src/db/sql/events-actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export type ArchiveNodeDatabaseRow = {
// Current status of the block within the chain.
chain_status: string;

// Sequence number of the transaction within a block
sequence_number: number;

// Hash representing the ledger state.
ledger_hash: string;

Expand Down
12 changes: 10 additions & 2 deletions src/services/data-adapters/database-row-adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,19 @@ function mapActionOrEvent(
const event = createEvent(elementIdToFieldValues, transactionInfo);
data.push(event);
} else {
const { zkapp_account_update_id } = rows[i];
const {
zkapp_account_update_id,
zkapp_account_updates_ids,
sequence_number,
zkapp_event_element_ids,
} = rows[i];
const action = createAction(
zkapp_account_update_id.toString(),
elementIdToFieldValues,
transactionInfo
transactionInfo,
sequence_number,
zkapp_account_updates_ids,
zkapp_event_element_ids
);
data.push(action);
}
Expand Down

0 comments on commit ddd8b27

Please sign in to comment.