Skip to content

Commit 256d284

Browse files
committed
chore: fix maddia comments
1 parent 3a70678 commit 256d284

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ describe('e2e_lending_contract', () => {
8787
const account = new Account(aztecRpcServer, privateKey, new AuthWitnessAccountContract(privateKey));
8888
const deployTx = await account.deploy();
8989
await deployTx.wait({ interval: 0.1 });
90-
// wallet = await account.getWallet();
9190
wallet = new AuthWitnessEntrypointWallet(
9291
aztecRpcServer,
9392
(await account.getEntrypoint()) as unknown as IAuthWitnessAccountEntrypoint,

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ describe('e2e_token_contract', () => {
572572
it.skip('transfer into account to overflow', () => {
573573
// This should already be covered by the mint case earlier. e.g., since we cannot mint to overflow, there is not
574574
// a way to get funds enough to overflow.
575+
// Require direct storage manipulation for us to perform a nice explicit case though.
576+
// See https://github.com/AztecProtocol/aztec-packages/issues/1259
575577
});
576578
});
577579
});
@@ -703,7 +705,12 @@ describe('e2e_token_contract', () => {
703705
expect(await asset.methods.balance_of_private({ address: accounts[1].address }).view()).toEqual(balance1);
704706
});
705707

706-
it.skip('transfer into account to overflow', () => {});
708+
it.skip('transfer into account to overflow', () => {
709+
// This should already be covered by the mint case earlier. e.g., since we cannot mint to overflow, there is not
710+
// a way to get funds enough to overflow.
711+
// Require direct storage manipulation for us to perform a nice explicit case though.
712+
// See https://github.com/AztecProtocol/aztec-packages/issues/1259
713+
});
707714

708715
it('transfer on behalf of other without approval', async () => {
709716
const balance0 = await asset.methods.balance_of_private({ address: accounts[0].address }).view();

yarn-project/sequencer-client/src/sequencer/sequencer.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,7 @@ export class Sequencer {
149149

150150
// Only accept processed transactions that are not double-spends
151151
// public functions emitting nullifiers would pass earlier check but fail here
152-
const isDoubleSpends = await Promise.all(
153-
processedTxs.map(async tx => await this.isTxDoubleSpend(tx as unknown as Tx)),
154-
);
155-
const doubleSpends = processedTxs.filter((tx, index) => isDoubleSpends[index]).map(tx => tx.hash);
156-
await this.p2pClient.deleteTxs(doubleSpends);
157-
const processedValidTxs = processedTxs.filter((tx, index) => !isDoubleSpends[index]);
152+
const processedValidTxs = await this.takeValidProcessedTxs(processedTxs);
158153

159154
if (processedValidTxs.length === 0) {
160155
this.log('No txs processed correctly to build block. Exiting');
@@ -258,6 +253,13 @@ export class Sequencer {
258253
return validTxs;
259254
}
260255

256+
protected async takeValidProcessedTxs(txs: ProcessedTx[]) {
257+
const isDoubleSpends = await Promise.all(txs.map(async tx => await this.isTxDoubleSpend(tx as unknown as Tx)));
258+
const doubleSpends = txs.filter((tx, index) => isDoubleSpends[index]).map(tx => tx.hash);
259+
await this.p2pClient.deleteTxs(doubleSpends);
260+
return txs.filter((tx, index) => !isDoubleSpends[index]);
261+
}
262+
261263
/**
262264
* Returns whether the previous block sent has been mined, and all dependencies have caught up with it.
263265
* @returns Boolean indicating if our dependencies are synced to the latest block.

0 commit comments

Comments
 (0)