Add quorum information to org

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2021-10-01 10:43:55 +02:00
parent 6d447622a2
commit b58d7b1cb7
2 changed files with 19 additions and 0 deletions
+5
View File
@@ -6,6 +6,7 @@ import { OperationType } from "@gnosis.pm/safe-core-sdk-types";
import { Profile, ProfileType } from '@app/profile';
import { assert } from '@app/error';
import * as utils from '@app/utils';
import type { Safe } from '@app/utils';
import type { Config } from '@app/config';
import type { Project } from '@app/project';
@@ -115,6 +116,10 @@ export class Org {
return [];
}
async getSafe(config: Config): Promise<Safe | null> {
return utils.getSafe(this.owner, config);
}
async isMember(address: string, config: Config): Promise<boolean> {
const members = await this.getMembers(config);
return members.includes(ethers.utils.getAddress(address));
+14
View File
@@ -260,6 +260,20 @@
{/await}
</div>
{/if}
<!-- Quorum -->
<div class="label">Quorum</div>
<div>
{#await org.getSafe(config)}
<Loading small />
{:then safe}
{#if safe}
{safe.threshold} <span class="faded">of</span> {safe.owners.length}
{:else}
N/A
{/if}
{/await}
</div>
<div></div>
</div>
{#await org.getMembers(config)}