Skip to content

Commit 4cba4e4

Browse files
committed
chore: fix maddia comments
1 parent 276801a commit 4cba4e4

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
@@ -148,12 +148,7 @@ export class Sequencer {
148148

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

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

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

0 commit comments

Comments
 (0)