Skip to content

Commit

Permalink
Add in default for MerkleWitness
Browse files Browse the repository at this point in the history
  • Loading branch information
ejMina226 committed Nov 8, 2024
1 parent 4716476 commit 9d32968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/protocol/src/model/StateTransitionProvableBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class StateTransitionProvableBatch extends Struct({
): StateTransitionProvableBatch {
const batch = transitions.map((entry) => entry.transition);
const transitionTypes = transitions.map((entry) => entry.type);

const witnesses = merkleWitnesses.slice();
// Check that order is correct
let normalSTsStarted = false;
transitionTypes.forEach((x) => {
Expand All @@ -90,11 +90,12 @@ export class StateTransitionProvableBatch extends Struct({
while (batch.length < constants.stateTransitionProverBatchSize) {
batch.push(ProvableStateTransition.dummy());
transitionTypes.push(ProvableStateTransitionType.normal);
witnesses.push(new RollupMerkleTreeWitness({ path: [], isLeft: [] }));
}
return new StateTransitionProvableBatch({
batch,
transitionTypes,
merkleWitnesses,
merkleWitnesses: witnesses,
});
}

Expand Down

0 comments on commit 9d32968

Please sign in to comment.