From 14288ca2af2301f71d777ec2b3e6189405d65bd7 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 31 Jan 2024 12:54:58 +0000 Subject: [PATCH] improved readability --- .../src/world-state-db/merkle_trees.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yarn-project/world-state/src/world-state-db/merkle_trees.ts b/yarn-project/world-state/src/world-state-db/merkle_trees.ts index c11960c7eb6..3a55636c273 100644 --- a/yarn-project/world-state/src/world-state-db/merkle_trees.ts +++ b/yarn-project/world-state/src/world-state-db/merkle_trees.ts @@ -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. */ @@ -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
{ const state = await this.getStateReference(includeUncommitted); return new Header(AppendOnlyTreeSnapshot.zero(), Buffer.alloc(32, 0), state, GlobalVariables.empty());