Skip to content

Commit

Permalink
Merge pull request #4992 from connext/4971-lh-proveandprocess-works-s…
Browse files Browse the repository at this point in the history
…taging

fix: 4971 lh proveandprocess works staging
  • Loading branch information
liu-zhipeng authored Oct 11, 2023
2 parents aac21ab + b4fd458 commit f4fac4b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/adapters/database/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
StableSwapTransfer,
StableSwapLpBalance,
RootMessageStatus,
convertFromDbPropagatedRoot,
} from "@connext/nxtp-utils";
import { Pool } from "pg";
import * as db from "zapatos/db";
Expand Down Expand Up @@ -901,13 +902,13 @@ export const getAggregateRoot = async (
};

export const getAggregateRootCount = async (
received_root: string,
aggreateRoot: string,
_pool?: Pool | db.TxnClientForRepeatableRead,
): Promise<number | undefined> => {
const poolToUse = _pool ?? pool;
// Get the leaf count at the aggregated root
const root = await db.selectOne("aggregated_roots", { received_root }).run(poolToUse);
return root ? convertFromDbAggregatedRoot(root).index : undefined;
const root = await db.selectOne("propagated_roots", { aggregate_root: aggreateRoot }).run(poolToUse);
return root ? convertFromDbPropagatedRoot(root).count : undefined;
};

export const getAggregateRoots = async (
Expand Down

0 comments on commit f4fac4b

Please sign in to comment.