Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const noopDeserializer: FromBuffer<Buffer> = {
* Standard implementation of an indexed tree.
*/
export class StandardIndexedTree extends TreeBase<Buffer> implements IndexedTree {
#snapshotBuilder = new IndexedTreeSnapshotBuilder(this.store, this, this.leafPreimageFactory);
#snapshotBuilder: IndexedTreeSnapshotBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing the target, it complains that you're using this.leafPreimageFactory before it is initialized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the output of swc and it reorders it:

export class StandardIndexedTree extends TreeBase {
    leafPreimageFactory;
    leafFactory;
    #snapshotBuilder;
    cachedLeafPreimages;
    leaves;
    leafIndex;
    constructor(store, hasher, name, depth, size = 0n, leafPreimageFactory, leafFactory, root){
        super(store, hasher, name, depth, size, noopDeserializer, root), this.leafPreimageFactory = leafPreimageFactory, this.leafFactory = leafFactory, this.#snapshotBuilder = new IndexedTreeSnapshotBuilder(this.store, this, this.leafPreimageFactory), this.cachedLeafPreimages = {};
        this.leaves = store.openMap(`tree_${name}_leaves`);
        this.leafIndex = store.openMap(`tree_${name}_leaf_index`);
    }
    // ...


protected cachedLeafPreimages: { [key: string]: IndexedTreeLeafPreimage } = {};
protected leaves: AztecMap<ReturnType<typeof buildDbKeyForPreimage>, Buffer>;
Expand All @@ -79,6 +79,7 @@ export class StandardIndexedTree extends TreeBase<Buffer> implements IndexedTree
super(store, hasher, name, depth, size, noopDeserializer, root);
this.leaves = store.openMap(`tree_${name}_leaves`);
this.leafIndex = store.openMap(`tree_${name}_leaf_index`);
this.#snapshotBuilder = new IndexedTreeSnapshotBuilder(this.store, this, this.leafPreimageFactory);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/prover-node/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { ProverNodePublisher } from '../prover-node-publisher.js';
import { ProverNode } from '../prover-node.js';

class TestProverNode_ extends ProverNode {
public override prover!: EpochProverManager;
public override publisher!: ProverNodePublisher;
public declare prover: EpochProverManager;
public declare publisher: ProverNodePublisher;
}

export type TestProverNode = TestProverNode_;
8 changes: 4 additions & 4 deletions yarn-project/sequencer-client/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { Sequencer } from '../sequencer/sequencer.js';
import type { SequencerTimetable } from '../sequencer/timetable.js';

class TestSequencer_ extends Sequencer {
public override publicProcessorFactory!: PublicProcessorFactory;
public override timetable!: SequencerTimetable;
public override publisher!: SequencerPublisher;
public declare publicProcessorFactory: PublicProcessorFactory;
public declare timetable: SequencerTimetable;
public declare publisher: SequencerPublisher;
}

export type TestSequencer = TestSequencer_;

class TestSequencerClient_ extends SequencerClient {
public override sequencer!: TestSequencer;
public declare sequencer: TestSequencer;
}

export type TestSequencerClient = TestSequencerClient_;
2 changes: 1 addition & 1 deletion yarn-project/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2020",
"target": "es2022",
"lib": ["dom", "esnext", "es2017.object"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
Expand Down