import { BigNumber } from '@pigi/core-utils' ; import { MerkleTree } from '@pigi/core-db' ; import { QuantifierResult , Quantifier } from '../../types' ; interface MerkleInclusionQuantifierParameters { root : Buffer ; key : BigNumber ; } export class MerkleInclusionQuantifier implements Quantifier { public constructor ( private readonly tree ) { } param input returns public async getAllQuantified ( input ) { const leafData = await this . tree . getLeaf ( input . key , input . root ) ; return { results : leafData ? [ leafData ] : [ undefined ] , allResultsQuantified : ! ! leafData , } ; } }