From 5bd4aa5ad89cf122dec25ee5ba7943b122bb7887 Mon Sep 17 00:00:00 2001 From: phn210 Date: Wed, 24 Jan 2024 02:57:47 +0100 Subject: [PATCH] expose public getters --- src/contracts/CampaignStorage.ts | 4 ++++ src/contracts/FundingStorage.ts | 4 ++++ src/contracts/ParticipationStorage.ts | 8 ++++++++ src/contracts/ProjectStorage.ts | 8 ++++++++ src/contracts/SharedStorage.ts | 8 ++++++++ src/contracts/TreasuryStorage.ts | 4 ++++ 6 files changed, 36 insertions(+) diff --git a/src/contracts/CampaignStorage.ts b/src/contracts/CampaignStorage.ts index 7c20d24..5b73888 100644 --- a/src/contracts/CampaignStorage.ts +++ b/src/contracts/CampaignStorage.ts @@ -46,6 +46,10 @@ export abstract class CampaignStorage { return this._level1.getRoot(); } + get level1(): Level1MT { + return this._level1; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; } diff --git a/src/contracts/FundingStorage.ts b/src/contracts/FundingStorage.ts index 3f384c1..eb9cb40 100644 --- a/src/contracts/FundingStorage.ts +++ b/src/contracts/FundingStorage.ts @@ -45,6 +45,10 @@ export abstract class FundingStorage { return this._level1.getRoot(); } + get level1(): Level1MT { + return this._level1; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; } diff --git a/src/contracts/ParticipationStorage.ts b/src/contracts/ParticipationStorage.ts index a03e7c9..f672888 100644 --- a/src/contracts/ParticipationStorage.ts +++ b/src/contracts/ParticipationStorage.ts @@ -57,6 +57,10 @@ export abstract class ParticipationCStorage { return this._level1.getRoot(); } + get level1(): Level1CMT { + return this._level1; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; } @@ -128,6 +132,10 @@ export abstract class ParticipationStorage { return this._level1.getRoot(); } + get level1(): Level1MT { + return this._level1; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; } diff --git a/src/contracts/ProjectStorage.ts b/src/contracts/ProjectStorage.ts index f6b3885..59af9be 100644 --- a/src/contracts/ProjectStorage.ts +++ b/src/contracts/ProjectStorage.ts @@ -72,6 +72,14 @@ export abstract class ProjectStorage { return this._level1.getRoot(); } + get level1(): Level1MT { + return this._level1; + } + + get level2s(): { [key: string]: Level2MT } { + return this._level2s; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; } diff --git a/src/contracts/SharedStorage.ts b/src/contracts/SharedStorage.ts index 0c8e00d..a960502 100644 --- a/src/contracts/SharedStorage.ts +++ b/src/contracts/SharedStorage.ts @@ -45,6 +45,10 @@ export class AddressStorage { return this._addressMap.getRoot(); } + get addressMap(): AddressMT { + return this._addressMap; + } + get addresses(): { [key: string]: { raw: PublicKey | undefined; leaf: Field }; } { @@ -142,6 +146,10 @@ export class ReduceStorage { return this._actionMap.getRoot(); } + get actionMap(): MerkleMap { + return this._actionMap; + } + get actions(): { [key: string]: Field } { return this._actions; } diff --git a/src/contracts/TreasuryStorage.ts b/src/contracts/TreasuryStorage.ts index 9e4edc6..bc21cd0 100644 --- a/src/contracts/TreasuryStorage.ts +++ b/src/contracts/TreasuryStorage.ts @@ -49,6 +49,10 @@ export abstract class TreasuryCStorage { return this._level1.getRoot(); } + get level1(): Level1CMT { + return this._level1; + } + get leafs(): { [key: string]: { raw: RawLeaf | undefined; leaf: Field } } { return this._leafs; }