Skip to content

Commit d6e0473

Browse files
fix types; small tweaks in data model
1 parent ef9799d commit d6e0473

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

src/dao.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import { IVote, IVoteQueryOptions, Vote } from './vote'
1515

1616
export interface IDAOState {
1717
address: Address // address of the avatar
18+
dao: DAO
19+
memberCount: number
1820
name: string
1921
reputation: Reputation
20-
memberCount: number
2122
reputationTotalSupply: typeof BN
2223
token: Token
2324
tokenName: string
@@ -96,6 +97,7 @@ export class DAO implements IStateful<IDAOState> {
9697
}
9798
return {
9899
address: item.id,
100+
dao: this,
99101
memberCount: Number(item.reputationHoldersCount),
100102
name: item.name,
101103
reputation: new Reputation(item.nativeReputation.id, this.context),

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Arc } from './arc'
2-
export { Arc }
3-
export default Arc
1+
export { Arc, IContractInfo } from './arc'
42
export { DAO, IDAOState } from './dao'
53
export { Member, IMemberState } from './member'
64
export { ITransactionUpdate, ITransactionState } from './operation'
@@ -14,3 +12,5 @@ export { Token, ITokenState } from './token'
1412
export { Stake, IStake, IStakeQueryOptions } from './stake'
1513
export { Vote, IVote, IVoteQueryOptions } from './vote'
1614
export { Address } from './types'
15+
import { Arc } from './arc'
16+
export default Arc

src/proposal.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export interface IProposalState {
7777
paramsHash: string
7878
preBoostedAt: Date
7979
preBoostedVotePeriodLimit: number
80+
proposal: Proposal
8081
proposer: Address
8182
proposingRepReward: typeof BN // in REP
8283
queuedVoteRequiredPercentage: number
@@ -100,8 +101,9 @@ export interface IProposalState {
100101
votesAgainst: typeof BN
101102
votesCount: number
102103
voteOnBehalf: Address
103-
winningOutcome: IProposalOutcome
104104
votersReputationLossRatio: number // in 1000's
105+
votingMachine: Address
106+
winningOutcome: IProposalOutcome
105107
minimumDaoBounty: typeof BN // in GEN
106108
}
107109

@@ -338,6 +340,7 @@ export class Proposal implements IStateful<IProposalState> {
338340
}
339341
votesAgainst
340342
votesFor
343+
votingMachine
341344
winningOutcome
342345
}
343346
}
@@ -479,6 +482,7 @@ export class Proposal implements IStateful<IProposalState> {
479482
paramsHash: item.paramsHash,
480483
preBoostedAt: Number(item.preBoostedAt),
481484
preBoostedVotePeriodLimit: Number(item.preBoostedVotePeriodLimit),
485+
proposal: this,
482486
proposer: item.proposer,
483487
proposingRepReward: new BN(item.proposingRepReward),
484488
queue: queueState,
@@ -503,6 +507,7 @@ export class Proposal implements IStateful<IProposalState> {
503507
votesAgainst: new BN(item.votesAgainst),
504508
votesCount: item.votes.length,
505509
votesFor: new BN(item.votesFor),
510+
votingMachine: item.votingMachine,
506511
winningOutcome: IProposalOutcome[item.winningOutcome] as any
507512
}
508513
}
@@ -759,8 +764,8 @@ interface IProposalBaseCreateOptions {
759764
url?: string
760765
}
761766

762-
export type IProposalCreateOptions = IProposalBaseCreateOptions & (
763-
GenericScheme.IProposalCreateOptionsGS &
764-
SchemeRegistrar.IProposalCreateOptionsSR &
765-
ContributionReward.IProposalCreateOptionsCR
767+
export type IProposalCreateOptions = (
768+
(IProposalBaseCreateOptions & GenericScheme.IProposalCreateOptionsGS ) |
769+
(IProposalBaseCreateOptions & SchemeRegistrar.IProposalCreateOptionsSR) |
770+
(IProposalBaseCreateOptions & ContributionReward.IProposalCreateOptionsCR)
766771
)

0 commit comments

Comments
 (0)