diff --git a/src/helpers/dao.ts b/src/helpers/dao.ts index 9debbdaf..b8af7f20 100644 --- a/src/helpers/dao.ts +++ b/src/helpers/dao.ts @@ -392,22 +392,34 @@ export class Dao { ); } - async queryTotalVotingPower(): Promise { + async queryTotalVotingPower( + height?: number, + ): Promise { return await this.chain.queryContract( this.contracts.core.address, { - total_power_at_height: {}, + total_power_at_height: + typeof height === 'undefined' ? {} : { height: height }, }, ); } - async queryVotingPower(addr: string): Promise { + async queryVotingPower( + addr: string, + height?: number, + ): Promise { return await this.chain.queryContract( this.contracts.core.address, { - voting_power_at_height: { - address: addr, - }, + voting_power_at_height: + typeof height === 'undefined' + ? { + address: addr, + } + : { + address: addr, + height: height, + }, }, ); }