Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Nov 3, 2023
1 parent b550098 commit 1ab9566
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions yarn-project/types/src/l2_block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,30 +705,24 @@ export class L2Block {
);
}

const newCommitments = this.newCommitments.slice(
MAX_NEW_COMMITMENTS_PER_TX * txIndex,
MAX_NEW_COMMITMENTS_PER_TX * (txIndex + 1),
);
const newNullifiers = this.newNullifiers.slice(
MAX_NEW_NULLIFIERS_PER_TX * txIndex,
MAX_NEW_NULLIFIERS_PER_TX * (txIndex + 1),
);
const newPublicDataWrites = this.newPublicDataWrites.slice(
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * txIndex,
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * (txIndex + 1),
);
const newL2ToL1Msgs = this.newL2ToL1Msgs.slice(
MAX_NEW_L2_TO_L1_MSGS_PER_TX * txIndex,
MAX_NEW_L2_TO_L1_MSGS_PER_TX * (txIndex + 1),
);
const newContracts = this.newContracts.slice(
MAX_NEW_CONTRACTS_PER_TX * txIndex,
MAX_NEW_CONTRACTS_PER_TX * (txIndex + 1),
);
const newContractData = this.newContractData.slice(
MAX_NEW_CONTRACTS_PER_TX * txIndex,
MAX_NEW_CONTRACTS_PER_TX * (txIndex + 1),
);
const newCommitments = this.newCommitments
.slice(MAX_NEW_COMMITMENTS_PER_TX * txIndex, MAX_NEW_COMMITMENTS_PER_TX * (txIndex + 1))
.filter(x => !x.isZero());
const newNullifiers = this.newNullifiers
.slice(MAX_NEW_NULLIFIERS_PER_TX * txIndex, MAX_NEW_NULLIFIERS_PER_TX * (txIndex + 1))
.filter(x => !x.isZero());
const newPublicDataWrites = this.newPublicDataWrites
.slice(MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * txIndex, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * (txIndex + 1))
.filter(x => !x.isEmpty());
const newL2ToL1Msgs = this.newL2ToL1Msgs
.slice(MAX_NEW_L2_TO_L1_MSGS_PER_TX * txIndex, MAX_NEW_L2_TO_L1_MSGS_PER_TX * (txIndex + 1))
.filter(x => !x.isZero());
const newContracts = this.newContracts
.slice(MAX_NEW_CONTRACTS_PER_TX * txIndex, MAX_NEW_CONTRACTS_PER_TX * (txIndex + 1))
.filter(x => !x.isZero());
const newContractData = this.newContractData
.slice(MAX_NEW_CONTRACTS_PER_TX * txIndex, MAX_NEW_CONTRACTS_PER_TX * (txIndex + 1))
.filter(x => !x.isEmpty());

return new L2Tx(
newCommitments,
Expand Down

0 comments on commit 1ab9566

Please sign in to comment.