diff --git a/yarn-project/aztec-node/src/aztec-node/server.test.ts b/yarn-project/aztec-node/src/aztec-node/server.test.ts index e063b609c316..c3635649d534 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.test.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.test.ts @@ -24,7 +24,7 @@ import { TX_ERROR_DUPLICATE_NULLIFIER_IN_TX, TX_ERROR_INCORRECT_L1_CHAIN_ID, TX_ERROR_INCORRECT_ROLLUP_VERSION, - TX_ERROR_INVALID_BLOCK_NUMBER, + TX_ERROR_INVALID_MAX_BLOCK_NUMBER, } from '@aztec/stdlib/tx'; import { getPackageVersion } from '@aztec/stdlib/update-checker'; @@ -224,7 +224,7 @@ describe('aztec node', () => { // Tx with max block number < current block number should be invalid expect(await node.isValidTx(invalidMaxBlockNumberMetadata)).toEqual({ result: 'invalid', - reason: [TX_ERROR_INVALID_BLOCK_NUMBER], + reason: [TX_ERROR_INVALID_MAX_BLOCK_NUMBER], }); // Tx with max block number >= current block number should be valid expect(await node.isValidTx(validMaxBlockNumberMetadata)).toEqual({ result: 'valid' }); diff --git a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts index 0cddb0319ee1..0e94a923c5a6 100644 --- a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts +++ b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts @@ -1,6 +1,6 @@ import { Fr, type PXE, type Wallet } from '@aztec/aztec.js'; import { TestContract } from '@aztec/noir-test-contracts.js/Test'; -import { TX_ERROR_INVALID_BLOCK_NUMBER } from '@aztec/stdlib/tx'; +import { TX_ERROR_INVALID_MAX_BLOCK_NUMBER } from '@aztec/stdlib/tx'; import { setup } from './fixtures/utils.js'; @@ -73,7 +73,7 @@ describe('e2e_max_block_number', () => { it('invalidates the transaction', async () => { await expect( contract.methods.set_tx_max_block_number(maxBlockNumber, enqueuePublicCall).send().wait(), - ).rejects.toThrow(TX_ERROR_INVALID_BLOCK_NUMBER); + ).rejects.toThrow(TX_ERROR_INVALID_MAX_BLOCK_NUMBER); }); }); @@ -89,7 +89,7 @@ describe('e2e_max_block_number', () => { it('invalidates the transaction', async () => { await expect( contract.methods.set_tx_max_block_number(maxBlockNumber, enqueuePublicCall).send().wait(), - ).rejects.toThrow(TX_ERROR_INVALID_BLOCK_NUMBER); + ).rejects.toThrow(TX_ERROR_INVALID_MAX_BLOCK_NUMBER); }); }); }); diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts index dca6deff327a..7221b6d85a6f 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts @@ -7,7 +7,7 @@ import { TX_ERROR_INCORRECT_PROTOCOL_CONTRACT_TREE_ROOT, TX_ERROR_INCORRECT_ROLLUP_VERSION, TX_ERROR_INCORRECT_VK_TREE_ROOT, - TX_ERROR_INVALID_BLOCK_NUMBER, + TX_ERROR_INVALID_MAX_BLOCK_NUMBER, } from '@aztec/stdlib/tx'; import { MetadataTxValidator } from './metadata_validator.js'; @@ -112,6 +112,6 @@ describe('MetadataTxValidator', () => { const [badTx] = await makeTxs(); badTx.data.rollupValidationRequests.maxBlockNumber = new MaxBlockNumber(true, blockNumber.sub(new Fr(1))); - await expectInvalid(badTx, TX_ERROR_INVALID_BLOCK_NUMBER); + await expectInvalid(badTx, TX_ERROR_INVALID_MAX_BLOCK_NUMBER); }); }); diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.ts b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.ts index f49954eaa3a5..79b17f7d3528 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.ts @@ -6,7 +6,7 @@ import { TX_ERROR_INCORRECT_PROTOCOL_CONTRACT_TREE_ROOT, TX_ERROR_INCORRECT_ROLLUP_VERSION, TX_ERROR_INCORRECT_VK_TREE_ROOT, - TX_ERROR_INVALID_BLOCK_NUMBER, + TX_ERROR_INVALID_MAX_BLOCK_NUMBER, Tx, type TxValidationResult, type TxValidator, @@ -28,7 +28,7 @@ export class MetadataTxValidator implements TxValidator { errors.push(TX_ERROR_INCORRECT_ROLLUP_VERSION); } if (!(await this.#isValidForBlockNumber(tx))) { - errors.push(TX_ERROR_INVALID_BLOCK_NUMBER); + errors.push(TX_ERROR_INVALID_MAX_BLOCK_NUMBER); } if (!(await this.#hasCorrectVkTreeRoot(tx))) { errors.push(TX_ERROR_INCORRECT_VK_TREE_ROOT); diff --git a/yarn-project/stdlib/src/tx/validator/error_texts.ts b/yarn-project/stdlib/src/tx/validator/error_texts.ts index fa2b2108941d..4f56adabe84c 100644 --- a/yarn-project/stdlib/src/tx/validator/error_texts.ts +++ b/yarn-project/stdlib/src/tx/validator/error_texts.ts @@ -11,7 +11,7 @@ export const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = 'Duplicate nullifier in tx'; export const TX_ERROR_EXISTING_NULLIFIER = 'Existing nullifier'; // Metadata -export const TX_ERROR_INVALID_BLOCK_NUMBER = 'Invalid block number'; +export const TX_ERROR_INVALID_MAX_BLOCK_NUMBER = 'Invalid max block number'; export const TX_ERROR_INCORRECT_L1_CHAIN_ID = 'Incorrect L1 chain id'; export const TX_ERROR_INCORRECT_ROLLUP_VERSION = 'Incorrect rollup version'; export const TX_ERROR_INCORRECT_VK_TREE_ROOT = 'Incorrect protocol circuits tree root';