From 9e8c94c9ffbc527c6f4cdf93cd23472828f6f858 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Fri, 19 Dec 2025 17:05:04 +0800 Subject: [PATCH 1/2] chore: further refining the block models to align optionality more between algod and indexer --- .../templates/models/custom/algod/block.ts.j2 | 70 +++++++++---------- packages/algod_client/src/models/block.ts | 70 +++++++++---------- packages/indexer_client/src/models/block.ts | 20 +++--- .../src/models/participation-updates.ts | 8 +-- 4 files changed, 84 insertions(+), 84 deletions(-) diff --git a/oas-generator/src/oas_generator/templates/models/custom/algod/block.ts.j2 b/oas-generator/src/oas_generator/templates/models/custom/algod/block.ts.j2 index 8521f6f3..e9f70472 100644 --- a/oas-generator/src/oas_generator/templates/models/custom/algod/block.ts.j2 +++ b/oas-generator/src/oas_generator/templates/models/custom/algod/block.ts.j2 @@ -188,9 +188,9 @@ const SignedTxnInBlockMeta: ObjectModelMetadata = { export type ParticipationUpdates = { /** [partupdrmv] Expired participation accounts. */ - expiredParticipationAccounts?: string[] + expiredParticipationAccounts: string[] /** [partupdabs] Absent participation accounts. */ - absentParticipationAccounts?: string[] + absentParticipationAccounts: string[] } const ParticipationUpdatesMeta: ObjectModelMetadata = { @@ -200,13 +200,13 @@ const ParticipationUpdatesMeta: ObjectModelMetadata = { { name: 'expiredParticipationAccounts', wireKey: 'partupdrmv', - optional: true, + optional: false, codec: addressArrayCodec, }, { name: 'absentParticipationAccounts', wireKey: 'partupdabs', - optional: true, + optional: false, codec: addressArrayCodec, }, ], @@ -235,36 +235,36 @@ const TxnCommitmentsMeta: ObjectModelMetadata = { /** Reward distribution state for the block. */ export type RewardState = { /** [fees] FeeSink address. */ - feeSink?: Address + feeSink: Address /** [rwd] RewardsPool address. */ - rewardsPool?: Address + rewardsPool: Address /** [earn] Rewards level. */ - rewardsLevel?: bigint + rewardsLevel: bigint /** [rate] Rewards rate. */ - rewardsRate?: bigint + rewardsRate: bigint /** [frac] Rewards residue. */ - rewardsResidue?: bigint + rewardsResidue: bigint /** [rwcalr] Rewards recalculation round. */ - rewardsRecalculationRound?: bigint + rewardsRecalculationRound: bigint } const RewardStateMeta: ObjectModelMetadata = { name: 'RewardState', kind: 'object', fields: [ - { name: 'feeSink', wireKey: 'fees', optional: true, codec: addressCodec }, - { name: 'rewardsPool', wireKey: 'rwd', optional: true, codec: addressCodec }, - { name: 'rewardsLevel', wireKey: 'earn', optional: true, codec: bigIntCodec }, - { name: 'rewardsRate', wireKey: 'rate', optional: true, codec: bigIntCodec }, - { name: 'rewardsResidue', wireKey: 'frac', optional: true, codec: bigIntCodec }, - { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: true, codec: bigIntCodec }, + { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec }, + { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec }, + { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec }, + { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec }, + { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec }, + { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec }, ], } /** Protocol upgrade state for the block. */ export type UpgradeState = { /** [proto] Current consensus protocol. */ - currentProtocol?: string + currentProtocol: string /** [nextproto] Next proposed protocol. */ nextProtocol?: string /** [nextyes] Next protocol approvals. */ @@ -279,7 +279,7 @@ const UpgradeStateMeta: ObjectModelMetadata = { name: 'UpgradeState', kind: 'object', fields: [ - { name: 'currentProtocol', wireKey: 'proto', optional: true, codec: stringCodec }, + { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec }, { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec }, { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec }, { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec }, @@ -309,21 +309,21 @@ const UpgradeVoteMeta: ObjectModelMetadata = { export type BlockHeader = { /** [rnd] Round number. */ - round?: bigint + round: bigint /** [prev] Previous block hash. */ - previousBlockHash?: Uint8Array + previousBlockHash: Uint8Array /** [prev512] Previous block hash using SHA-512. */ previousBlockHash512?: Uint8Array /** [seed] Sortition seed. */ - seed?: Uint8Array + seed: Uint8Array /** Authenticates the set of transactions appearing in the block. */ txnCommitments: TxnCommitments /** [ts] Block timestamp in seconds since epoch. */ - timestamp?: bigint + timestamp: bigint /** [gen] Genesis ID. */ - genesisId?: string + genesisId: string /** [gh] Genesis hash. */ - genesisHash?: Uint8Array + genesisHash: Uint8Array /** [prp] Proposer address. */ proposer?: Address /** [fc] Fees collected in this block. */ @@ -343,26 +343,26 @@ export type BlockHeader = { /** [spt] State proof tracking data keyed by state proof type. */ stateProofTracking?: Map /** Represents participation account data that needs to be checked/acted on by the network */ - participationUpdates?: ParticipationUpdates + participationUpdates: ParticipationUpdates } const BlockHeaderMeta: ObjectModelMetadata = { name: 'BlockHeader', kind: 'object', fields: [ - { name: 'round', wireKey: 'rnd', optional: true, codec: bigIntCodec }, - { name: 'previousBlockHash', wireKey: 'prev', optional: true, codec: fixedBytes32Codec }, + { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec }, + { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec }, { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec }, - { name: 'seed', wireKey: 'seed', optional: true, codec: bytesCodec }, + { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec }, { name: 'txnCommitments', flattened: true, optional: false, codec: new ObjectModelCodec(TxnCommitmentsMeta), }, - { name: 'timestamp', wireKey: 'ts', optional: true, codec: bigIntCodec }, - { name: 'genesisId', wireKey: 'gen', optional: true, codec: stringCodec }, - { name: 'genesisHash', wireKey: 'gh', optional: true, codec: fixedBytes32Codec }, + { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec }, + { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec }, + { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec }, { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec }, { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec }, { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec }, @@ -382,7 +382,7 @@ const BlockHeaderMeta: ObjectModelMetadata = { { name: 'upgradeVote', flattened: true, - optional: false, + optional: true, codec: new ObjectModelCodec(UpgradeVoteMeta), }, { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec }, @@ -395,7 +395,7 @@ const BlockHeaderMeta: ObjectModelMetadata = { { name: 'participationUpdates', flattened: true, - optional: true, + optional: false, codec: new ObjectModelCodec(ParticipationUpdatesMeta), }, ], @@ -409,7 +409,7 @@ export type Block = { header: BlockHeader /** [txns] Block transactions (Payset). */ - payset?: SignedTxnInBlock[] + payset: SignedTxnInBlock[] } const BlockMeta: ObjectModelMetadata = { @@ -420,7 +420,7 @@ const BlockMeta: ObjectModelMetadata = { { name: 'payset', wireKey: 'txns', - optional: true, + optional: false, codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)), }, ], diff --git a/packages/algod_client/src/models/block.ts b/packages/algod_client/src/models/block.ts index 8521f6f3..e9f70472 100644 --- a/packages/algod_client/src/models/block.ts +++ b/packages/algod_client/src/models/block.ts @@ -188,9 +188,9 @@ const SignedTxnInBlockMeta: ObjectModelMetadata = { export type ParticipationUpdates = { /** [partupdrmv] Expired participation accounts. */ - expiredParticipationAccounts?: string[] + expiredParticipationAccounts: string[] /** [partupdabs] Absent participation accounts. */ - absentParticipationAccounts?: string[] + absentParticipationAccounts: string[] } const ParticipationUpdatesMeta: ObjectModelMetadata = { @@ -200,13 +200,13 @@ const ParticipationUpdatesMeta: ObjectModelMetadata = { { name: 'expiredParticipationAccounts', wireKey: 'partupdrmv', - optional: true, + optional: false, codec: addressArrayCodec, }, { name: 'absentParticipationAccounts', wireKey: 'partupdabs', - optional: true, + optional: false, codec: addressArrayCodec, }, ], @@ -235,36 +235,36 @@ const TxnCommitmentsMeta: ObjectModelMetadata = { /** Reward distribution state for the block. */ export type RewardState = { /** [fees] FeeSink address. */ - feeSink?: Address + feeSink: Address /** [rwd] RewardsPool address. */ - rewardsPool?: Address + rewardsPool: Address /** [earn] Rewards level. */ - rewardsLevel?: bigint + rewardsLevel: bigint /** [rate] Rewards rate. */ - rewardsRate?: bigint + rewardsRate: bigint /** [frac] Rewards residue. */ - rewardsResidue?: bigint + rewardsResidue: bigint /** [rwcalr] Rewards recalculation round. */ - rewardsRecalculationRound?: bigint + rewardsRecalculationRound: bigint } const RewardStateMeta: ObjectModelMetadata = { name: 'RewardState', kind: 'object', fields: [ - { name: 'feeSink', wireKey: 'fees', optional: true, codec: addressCodec }, - { name: 'rewardsPool', wireKey: 'rwd', optional: true, codec: addressCodec }, - { name: 'rewardsLevel', wireKey: 'earn', optional: true, codec: bigIntCodec }, - { name: 'rewardsRate', wireKey: 'rate', optional: true, codec: bigIntCodec }, - { name: 'rewardsResidue', wireKey: 'frac', optional: true, codec: bigIntCodec }, - { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: true, codec: bigIntCodec }, + { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec }, + { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec }, + { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec }, + { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec }, + { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec }, + { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec }, ], } /** Protocol upgrade state for the block. */ export type UpgradeState = { /** [proto] Current consensus protocol. */ - currentProtocol?: string + currentProtocol: string /** [nextproto] Next proposed protocol. */ nextProtocol?: string /** [nextyes] Next protocol approvals. */ @@ -279,7 +279,7 @@ const UpgradeStateMeta: ObjectModelMetadata = { name: 'UpgradeState', kind: 'object', fields: [ - { name: 'currentProtocol', wireKey: 'proto', optional: true, codec: stringCodec }, + { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec }, { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec }, { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec }, { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec }, @@ -309,21 +309,21 @@ const UpgradeVoteMeta: ObjectModelMetadata = { export type BlockHeader = { /** [rnd] Round number. */ - round?: bigint + round: bigint /** [prev] Previous block hash. */ - previousBlockHash?: Uint8Array + previousBlockHash: Uint8Array /** [prev512] Previous block hash using SHA-512. */ previousBlockHash512?: Uint8Array /** [seed] Sortition seed. */ - seed?: Uint8Array + seed: Uint8Array /** Authenticates the set of transactions appearing in the block. */ txnCommitments: TxnCommitments /** [ts] Block timestamp in seconds since epoch. */ - timestamp?: bigint + timestamp: bigint /** [gen] Genesis ID. */ - genesisId?: string + genesisId: string /** [gh] Genesis hash. */ - genesisHash?: Uint8Array + genesisHash: Uint8Array /** [prp] Proposer address. */ proposer?: Address /** [fc] Fees collected in this block. */ @@ -343,26 +343,26 @@ export type BlockHeader = { /** [spt] State proof tracking data keyed by state proof type. */ stateProofTracking?: Map /** Represents participation account data that needs to be checked/acted on by the network */ - participationUpdates?: ParticipationUpdates + participationUpdates: ParticipationUpdates } const BlockHeaderMeta: ObjectModelMetadata = { name: 'BlockHeader', kind: 'object', fields: [ - { name: 'round', wireKey: 'rnd', optional: true, codec: bigIntCodec }, - { name: 'previousBlockHash', wireKey: 'prev', optional: true, codec: fixedBytes32Codec }, + { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec }, + { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec }, { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec }, - { name: 'seed', wireKey: 'seed', optional: true, codec: bytesCodec }, + { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec }, { name: 'txnCommitments', flattened: true, optional: false, codec: new ObjectModelCodec(TxnCommitmentsMeta), }, - { name: 'timestamp', wireKey: 'ts', optional: true, codec: bigIntCodec }, - { name: 'genesisId', wireKey: 'gen', optional: true, codec: stringCodec }, - { name: 'genesisHash', wireKey: 'gh', optional: true, codec: fixedBytes32Codec }, + { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec }, + { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec }, + { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec }, { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec }, { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec }, { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec }, @@ -382,7 +382,7 @@ const BlockHeaderMeta: ObjectModelMetadata = { { name: 'upgradeVote', flattened: true, - optional: false, + optional: true, codec: new ObjectModelCodec(UpgradeVoteMeta), }, { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec }, @@ -395,7 +395,7 @@ const BlockHeaderMeta: ObjectModelMetadata = { { name: 'participationUpdates', flattened: true, - optional: true, + optional: false, codec: new ObjectModelCodec(ParticipationUpdatesMeta), }, ], @@ -409,7 +409,7 @@ export type Block = { header: BlockHeader /** [txns] Block transactions (Payset). */ - payset?: SignedTxnInBlock[] + payset: SignedTxnInBlock[] } const BlockMeta: ObjectModelMetadata = { @@ -420,7 +420,7 @@ const BlockMeta: ObjectModelMetadata = { { name: 'payset', wireKey: 'txns', - optional: true, + optional: false, codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)), }, ], diff --git a/packages/indexer_client/src/models/block.ts b/packages/indexer_client/src/models/block.ts index a5b19e33..5d58ac4f 100644 --- a/packages/indexer_client/src/models/block.ts +++ b/packages/indexer_client/src/models/block.ts @@ -68,7 +68,7 @@ export type Block = { * \[prev512\] Previous block hash, using SHA-512. */ previousBlockHash512?: Uint8Array - rewards?: BlockRewards + rewards: BlockRewards /** * \[rnd\] Current round on which this block was appended to the chain. @@ -93,7 +93,7 @@ export type Block = { /** * \[txns\] list of transactions corresponding to a given round. */ - transactions?: Transaction[] + transactions: Transaction[] /** * \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. @@ -103,7 +103,7 @@ export type Block = { /** * \[txn256\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists. */ - transactionsRootSha256: Uint8Array + transactionsRootSha256?: Uint8Array /** * \[txn512\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256. @@ -116,9 +116,9 @@ export type Block = { * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported). */ txnCounter?: number - upgradeState?: BlockUpgradeState + upgradeState: BlockUpgradeState upgradeVote?: BlockUpgradeVote - participationUpdates?: ParticipationUpdates + participationUpdates: ParticipationUpdates } export const BlockMeta: ObjectModelMetadata = { @@ -176,7 +176,7 @@ export const BlockMeta: ObjectModelMetadata = { { name: 'rewards', wireKey: 'rewards', - optional: true, + optional: false, codec: new ObjectModelCodec(BlockRewardsMeta), }, { @@ -206,7 +206,7 @@ export const BlockMeta: ObjectModelMetadata = { { name: 'transactions', wireKey: 'transactions', - optional: true, + optional: false, codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)), }, { @@ -218,7 +218,7 @@ export const BlockMeta: ObjectModelMetadata = { { name: 'transactionsRootSha256', wireKey: 'transactions-root-sha256', - optional: false, + optional: true, codec: fixedBytes32Codec, }, { @@ -236,7 +236,7 @@ export const BlockMeta: ObjectModelMetadata = { { name: 'upgradeState', wireKey: 'upgrade-state', - optional: true, + optional: false, codec: new ObjectModelCodec(BlockUpgradeStateMeta), }, { @@ -248,7 +248,7 @@ export const BlockMeta: ObjectModelMetadata = { { name: 'participationUpdates', wireKey: 'participation-updates', - optional: true, + optional: false, codec: new ObjectModelCodec(ParticipationUpdatesMeta), }, ], diff --git a/packages/indexer_client/src/models/participation-updates.ts b/packages/indexer_client/src/models/participation-updates.ts index b8058d79..87ce2611 100644 --- a/packages/indexer_client/src/models/participation-updates.ts +++ b/packages/indexer_client/src/models/participation-updates.ts @@ -8,12 +8,12 @@ export type ParticipationUpdates = { /** * \[partupdrmv\] a list of online accounts that needs to be converted to offline since their participation key expired. */ - expiredParticipationAccounts?: string[] + expiredParticipationAccounts: string[] /** * \[partupabs\] a list of online accounts that need to be suspended. */ - absentParticipationAccounts?: string[] + absentParticipationAccounts: string[] } export const ParticipationUpdatesMeta: ObjectModelMetadata = { @@ -23,13 +23,13 @@ export const ParticipationUpdatesMeta: ObjectModelMetadata { name: 'expiredParticipationAccounts', wireKey: 'expired-participation-accounts', - optional: true, + optional: false, codec: stringArrayCodec, }, { name: 'absentParticipationAccounts', wireKey: 'absent-participation-accounts', - optional: true, + optional: false, codec: stringArrayCodec, }, ], From 2d9da9926bd254b5113a071a4a5d683bcff87944 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Fri, 19 Dec 2025 18:10:17 +0800 Subject: [PATCH 2/2] chore: update indexer snapshots --- .../get_v2_deltas_round.test.ts.snap | 7 ++++++- .../get_v2_block_headers.test.ts.snap | 5 +++++ .../get_v2_blocks_round_number.test.ts.snap | 4 ++++ packages/indexer_client/tests/schemas.ts | 16 ++++++++-------- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/packages/algod_client/tests/__snapshots__/get_v2_deltas_round.test.ts.snap b/packages/algod_client/tests/__snapshots__/get_v2_deltas_round.test.ts.snap index 67270fb5..78e896fa 100644 --- a/packages/algod_client/tests/__snapshots__/get_v2_deltas_round.test.ts.snap +++ b/packages/algod_client/tests/__snapshots__/get_v2_deltas_round.test.ts.snap @@ -3048,6 +3048,10 @@ exports[`GET v2_deltas_ROUND > Common Tests > Basic request and response validat 223, ], "genesisId": "mainnet-v1.0", + "participationUpdates": { + "absentParticipationAccounts": [], + "expiredParticipationAccounts": [], + }, "previousBlockHash": Uint8Array [ 41, 2, @@ -3261,6 +3265,7 @@ exports[`GET v2_deltas_ROUND > Common Tests > Basic request and response validat ], Symbol(algokit_common:Address): true, }, + "rewardsRate": 0n, "rewardsRecalculationRound": 55500000n, "rewardsResidue": 6886250026n, }, @@ -3445,8 +3450,8 @@ exports[`GET v2_deltas_ROUND > Common Tests > Basic request and response validat "upgradeState": { "currentProtocol": "https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed", }, - "upgradeVote": {}, }, + "payset": [], }, "creatables": Map { 3307475755 => { diff --git a/packages/indexer_client/tests/__snapshots__/get_v2_block_headers.test.ts.snap b/packages/indexer_client/tests/__snapshots__/get_v2_block_headers.test.ts.snap index 8bbe9426..489846c3 100644 --- a/packages/indexer_client/tests/__snapshots__/get_v2_block_headers.test.ts.snap +++ b/packages/indexer_client/tests/__snapshots__/get_v2_block_headers.test.ts.snap @@ -39,6 +39,10 @@ exports[`GET v2_block-headers > Common Tests > Basic request and response valida 34, ], "genesisId": "testnet-v1.0", + "participationUpdates": { + "absentParticipationAccounts": [], + "expiredParticipationAccounts": [], + }, "previousBlockHash": Uint8Array [ 0, 0, @@ -118,6 +122,7 @@ exports[`GET v2_block-headers > Common Tests > Basic request and response valida ], "stateProofTracking": [], "timestamp": 1560210455, + "transactions": [], "transactionsRoot": Uint8Array [ 39, 120, diff --git a/packages/indexer_client/tests/__snapshots__/get_v2_blocks_round_number.test.ts.snap b/packages/indexer_client/tests/__snapshots__/get_v2_blocks_round_number.test.ts.snap index 7e6d7047..17a30cc6 100644 --- a/packages/indexer_client/tests/__snapshots__/get_v2_blocks_round_number.test.ts.snap +++ b/packages/indexer_client/tests/__snapshots__/get_v2_blocks_round_number.test.ts.snap @@ -37,6 +37,10 @@ exports[`GET v2_blocks_ROUND-NUMBER > Common Tests > Basic request and response 34, ], "genesisId": "testnet-v1.0", + "participationUpdates": { + "absentParticipationAccounts": [], + "expiredParticipationAccounts": [], + }, "previousBlockHash": Uint8Array [ 132, 225, diff --git a/packages/indexer_client/tests/schemas.ts b/packages/indexer_client/tests/schemas.ts index d5c77a80..7a529550 100644 --- a/packages/indexer_client/tests/schemas.ts +++ b/packages/indexer_client/tests/schemas.ts @@ -2,7 +2,7 @@ * Auto-generated Zod schemas from OpenAPI specification. * Do not edit manually. * - * Generated: 2025-12-18T06:40:24.225Z + * Generated: 2025-12-19T11:38:22.460Z */ import { z } from 'zod' @@ -416,8 +416,8 @@ export const BlockUpgradeVote = z.object({ }) export const ParticipationUpdates = z.object({ - expiredParticipationAccounts: z.array(z.string()).optional(), - absentParticipationAccounts: z.array(z.string()).optional() + expiredParticipationAccounts: z.array(z.string()), + absentParticipationAccounts: z.array(z.string()) }) export const Block = z.object({ @@ -429,19 +429,19 @@ export const Block = z.object({ genesisId: z.string(), previousBlockHash: z.instanceof(Uint8Array), previousBlockHash512: z.instanceof(Uint8Array).optional(), - rewards: BlockRewards.optional(), + rewards: BlockRewards, round: z.bigint(), seed: z.instanceof(Uint8Array), stateProofTracking: z.array(StateProofTracking).optional(), timestamp: z.number().int(), - transactions: z.array(Transaction).optional(), + transactions: z.array(Transaction), transactionsRoot: z.instanceof(Uint8Array), - transactionsRootSha256: z.instanceof(Uint8Array), + transactionsRootSha256: z.instanceof(Uint8Array).optional(), transactionsRootSha512: z.instanceof(Uint8Array).optional(), txnCounter: z.number().int().optional(), - upgradeState: BlockUpgradeState.optional(), + upgradeState: BlockUpgradeState, upgradeVote: BlockUpgradeVote.optional(), - participationUpdates: ParticipationUpdates.optional() + participationUpdates: ParticipationUpdates }) export const Box = z.object({