Skip to content

Commit

Permalink
improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 31, 2024
1 parent fd5f3fc commit 14288ca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions yarn-project/world-state/src/world-state-db/merkle_trees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ export class MerkleTrees implements MerkleTreeDb {

private constructor(private store: AztecKVStore, private log: DebugLogger) {}

/**
* Method to asynchronously create and initialize a MerkleTrees instance.
* @param store - The db instance to use for data persistance.
* @returns - A fully initialized MerkleTrees instance.
*/
public static async new(store: AztecKVStore, log = createDebugLogger('aztec:merkle_trees')) {
const merkleTrees = new MerkleTrees(store, log);
await merkleTrees.#init();
return merkleTrees;
}

/**
* Initializes the collection of Merkle Trees.
*/
Expand Down Expand Up @@ -136,17 +147,6 @@ export class MerkleTrees implements MerkleTreeDb {
await this.#commit();
}

/**
* Method to asynchronously create and initialize a MerkleTrees instance.
* @param store - The db instance to use for data persistance.
* @returns - A fully initialized MerkleTrees instance.
*/
public static async new(store: AztecKVStore, log = createDebugLogger('aztec:merkle_trees')) {
const merkleTrees = new MerkleTrees(store, log);
await merkleTrees.#init();
return merkleTrees;
}

public async buildInitialHeader(includeUncommitted: boolean): Promise<Header> {
const state = await this.getStateReference(includeUncommitted);
return new Header(AppendOnlyTreeSnapshot.zero(), Buffer.alloc(32, 0), state, GlobalVariables.empty());
Expand Down

0 comments on commit 14288ca

Please sign in to comment.