Skip to content

Commit 460a87e

Browse files
authored
refactor(stdlib): remove deprecated RevertCode/TxExecutionResult aliases (#23249)
## Motivation The `RevertCode` and `TxExecutionResult` types each carried three deprecated aliases (`APP_LOGIC_REVERTED`, `TEARDOWN_REVERTED`, `BOTH_REVERTED`) that all collapse to the same `REVERTED` value. Keeping them around adds noise, requires `no-duplicate-enum-values` eslint suppressions, and lets new code keep reaching for the old names. ## Approach Removed the deprecated members from both enums and rewrote every call site to use `REVERTED` directly. Tests, fixtures, and a stale doc reference were updated to match. ## Changes - **stdlib**: Drop deprecated `APP_LOGIC_REVERTED`/`TEARDOWN_REVERTED`/`BOTH_REVERTED` from `RevertCode` and `TxExecutionResult`. - **simulator, pxe, aztec.js, end-to-end (tests)**: Replace remaining references with `REVERTED`. - **simulator/docs**: Update a stale `APP_LOGIC_REVERTED` reference in the public-tx-simulation doc.
1 parent ad97697 commit 460a87e

17 files changed

Lines changed: 31 additions & 56 deletions

File tree

yarn-project/aztec.js/src/utils/node.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('waitForTx', () => {
4242
const revertedReceipt = new TxReceipt(
4343
txHash,
4444
TxStatus.CHECKPOINTED,
45-
TxExecutionResult.APP_LOGIC_REVERTED,
45+
TxExecutionResult.REVERTED,
4646
undefined,
4747
undefined,
4848
undefined,
@@ -56,7 +56,7 @@ describe('waitForTx', () => {
5656
const revertedReceipt = new TxReceipt(
5757
txHash,
5858
TxStatus.CHECKPOINTED,
59-
TxExecutionResult.APP_LOGIC_REVERTED,
59+
TxExecutionResult.REVERTED,
6060
undefined,
6161
undefined,
6262
undefined,

yarn-project/end-to-end/src/e2e_cross_chain_messaging/l1_to_l2.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ describe('e2e_cross_chain_messaging l1_to_l2', () => {
270270
expect(block!.checkpointNumber).toEqual(msgCheckpointNumber);
271271
expect(block!.indexWithinCheckpoint).toEqual(IndexWithinCheckpoint.ZERO);
272272
} else {
273-
expect(receipt.executionResult).toEqual(TxExecutionResult.APP_LOGIC_REVERTED);
273+
expect(receipt.executionResult).toEqual(TxExecutionResult.REVERTED);
274274
}
275275
}
276276
await t.context.watcher.markAsProven();

yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('e2e_deploy_contract contract class registration', () => {
161161
const { receipt } = await contract.methods
162162
.increment_public_value(whom, 10)
163163
.send({ from: defaultAccountAddress, wait: { dontThrowOnRevert: true } });
164-
expect(receipt.executionResult).toEqual(TxExecutionResult.APP_LOGIC_REVERTED);
164+
expect(receipt.executionResult).toEqual(TxExecutionResult.REVERTED);
165165

166166
// Meanwhile we check we didn't increment the value
167167
expect(
@@ -205,7 +205,7 @@ describe('e2e_deploy_contract contract class registration', () => {
205205
const { receipt } = await contract.methods
206206
.public_constructor(whom, 43)
207207
.send({ from: defaultAccountAddress, wait: { dontThrowOnRevert: true } });
208-
expect(receipt.executionResult).toEqual(TxExecutionResult.APP_LOGIC_REVERTED);
208+
expect(receipt.executionResult).toEqual(TxExecutionResult.REVERTED);
209209
expect(
210210
(await contract.methods.get_public_value(whom).simulate({ from: defaultAccountAddress })).result,
211211
).toEqual(0n);
@@ -256,7 +256,7 @@ describe('e2e_deploy_contract contract class registration', () => {
256256
const { receipt: tx } = await instance.methods
257257
.increment_public_value_no_init_check(whom, 10)
258258
.send({ from: defaultAccountAddress, wait: { dontThrowOnRevert: true } });
259-
expect(tx.executionResult).toEqual(TxExecutionResult.APP_LOGIC_REVERTED);
259+
expect(tx.executionResult).toEqual(TxExecutionResult.REVERTED);
260260
});
261261
});
262262
});

yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('e2e_deploy_contract legacy', () => {
122122
expect(goodTxReceipt!.blockNumber).toEqual(expect.any(Number));
123123
expect(badTxReceipt!.blockNumber).toEqual(expect.any(Number));
124124

125-
expect(badTxReceipt!.executionResult).toEqual(TxExecutionResult.APP_LOGIC_REVERTED);
125+
expect(badTxReceipt!.executionResult).toEqual(TxExecutionResult.REVERTED);
126126

127127
const badInstance = await badDeploy.getInstance();
128128
// But the bad tx did not deploy the class

yarn-project/end-to-end/src/e2e_double_spend.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('e2e_double_spend', () => {
4646
// tx will be included in a block but with app logic reverted
4747
await expect(
4848
contract.methods.emit_nullifier_public(nullifier).send({ from: defaultAccountAddress }),
49-
).rejects.toThrow(TxExecutionResult.APP_LOGIC_REVERTED);
49+
).rejects.toThrow(TxExecutionResult.REVERTED);
5050
});
5151
});
5252
});

yarn-project/end-to-end/src/e2e_epochs/epochs_proof_public_cross_chain.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('e2e_epochs/epochs_proof_public_cross_chain', () => {
9898
globalLeafIndex.toBigInt(),
9999
)
100100
.send({ from: context.accounts[0], wait: { dontThrowOnRevert: true } });
101-
expect(failedReceipt.executionResult).toBe(TxExecutionResult.APP_LOGIC_REVERTED);
101+
expect(failedReceipt.executionResult).toBe(TxExecutionResult.REVERTED);
102102

103103
logger.info(`Test succeeded`);
104104
});

yarn-project/end-to-end/src/e2e_fees/failures.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('e2e_fees failures', () => {
9898
wait: { dontThrowOnRevert: true },
9999
});
100100

101-
expect(txReceipt.executionResult).toBe(TxExecutionResult.APP_LOGIC_REVERTED);
101+
expect(txReceipt.executionResult).toBe(TxExecutionResult.REVERTED);
102102

103103
const { sequencerBlockRewards } = await t.getBlockRewards();
104104

@@ -201,7 +201,7 @@ describe('e2e_fees failures', () => {
201201
wait: { dontThrowOnRevert: true },
202202
});
203203

204-
expect(txReceipt.executionResult).toBe(TxExecutionResult.APP_LOGIC_REVERTED);
204+
expect(txReceipt.executionResult).toBe(TxExecutionResult.REVERTED);
205205
const feeAmount = txReceipt.transactionFee!;
206206

207207
// and thus we paid the fee
@@ -298,7 +298,7 @@ describe('e2e_fees failures', () => {
298298
},
299299
wait: { dontThrowOnRevert: true },
300300
});
301-
expect(receipt.executionResult).toEqual(TxExecutionResult.TEARDOWN_REVERTED);
301+
expect(receipt.executionResult).toEqual(TxExecutionResult.REVERTED);
302302
expect(receipt.transactionFee).toBeGreaterThan(0n);
303303

304304
await expectMapping(
@@ -346,7 +346,7 @@ describe('e2e_fees failures', () => {
346346
wait: { dontThrowOnRevert: true },
347347
});
348348

349-
expect(receipt.executionResult).toBe(TxExecutionResult.BOTH_REVERTED);
349+
expect(receipt.executionResult).toBe(TxExecutionResult.REVERTED);
350350
expect(receipt.transactionFee).toBeGreaterThan(0n);
351351

352352
await t.context.watcher.trigger();

yarn-project/pxe/src/storage/tagging_store/sender_tagging_store.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ describe('SenderTaggingStore', () => {
494494
describe('finalizePendingIndexesOfAPartiallyRevertedTx', () => {
495495
function makeTxEffect(txHash: TxHash, siloedTags: SiloedTag[]): TxEffect {
496496
return new TxEffect(
497-
RevertCode.APP_LOGIC_REVERTED,
497+
RevertCode.REVERTED,
498498
txHash,
499499
Fr.ZERO,
500500
[Fr.random()], // noteHashes (at least 1 nullifier required below, not here)

yarn-project/pxe/src/tagging/sender_sync/sync_sender_tagging_indexes.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ describe('syncSenderTaggingIndexes', () => {
300300
);
301301
});
302302

303-
// Mock getTxReceipt to return FINALIZED with APP_LOGIC_REVERTED
303+
// Mock getTxReceipt to return FINALIZED with REVERTED
304304
aztecNode.getTxReceipt.mockResolvedValue(
305305
new TxReceipt(
306306
revertedTxHash,
307307
TxStatus.FINALIZED,
308-
TxExecutionResult.APP_LOGIC_REVERTED,
308+
TxExecutionResult.REVERTED,
309309
undefined,
310310
undefined,
311311
undefined,
@@ -315,7 +315,7 @@ describe('syncSenderTaggingIndexes', () => {
315315

316316
// Mock getTxEffect to return a TxEffect where only the tag at index 4 survived (non-revertible phase)
317317
const txEffect = new TxEffect(
318-
RevertCode.APP_LOGIC_REVERTED,
318+
RevertCode.REVERTED,
319319
revertedTxHash,
320320
Fr.ZERO,
321321
[Fr.random()], // noteHashes

yarn-project/pxe/src/tagging/sender_sync/utils/get_status_change_of_pending.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('getStatusChangeOfPending', () => {
5555
new TxReceipt(
5656
hash,
5757
TxStatus.FINALIZED,
58-
TxExecutionResult.APP_LOGIC_REVERTED,
58+
TxExecutionResult.REVERTED,
5959
undefined,
6060
undefined,
6161
undefined,
@@ -67,7 +67,7 @@ describe('getStatusChangeOfPending', () => {
6767
new TxReceipt(
6868
hash,
6969
TxStatus.FINALIZED,
70-
TxExecutionResult.TEARDOWN_REVERTED,
70+
TxExecutionResult.REVERTED,
7171
undefined,
7272
undefined,
7373
undefined,
@@ -79,7 +79,7 @@ describe('getStatusChangeOfPending', () => {
7979
new TxReceipt(
8080
hash,
8181
TxStatus.FINALIZED,
82-
TxExecutionResult.BOTH_REVERTED,
82+
TxExecutionResult.REVERTED,
8383
undefined,
8484
undefined,
8585
undefined,

0 commit comments

Comments
 (0)