Skip to content

Commit

Permalink
Fix GenesisProtocol.getProposal (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkent600 authored Jun 30, 2018
1 parent 6c2401f commit 285bec0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
14 changes: 8 additions & 6 deletions lib/wrappers/genesisProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -922,18 +922,19 @@ export class GenesisProtocolWrapper extends IntVoteInterfaceWrapper implements S
return {
avatarAddress: proposalArray[0],
boostedPhaseTime: proposalArray[7],
currentBoostedVotePeriodLimit: proposalArray[12],
currentBoostedVotePeriodLimit: proposalArray[11],
daoBountyRemain: proposalArray[13],
executable: proposalArray[2],
lostReputation: proposalArray[5],
numOfChoices: proposalArray[1].toNumber(),
paramsHash: proposalArray[13],
paramsHash: proposalArray[12],
proposalId,
proposer: proposalArray[11],
state: proposalArray[9],
submittedTime: proposalArray[6],
proposer: proposalArray[10],
state: proposalArray[8].toNumber(),
submittedTime: proposalArray[6].toNumber(),
totalVotes: proposalArray[3],
votersStakes: proposalArray[4],
winningVote: proposalArray[10],
winningVote: proposalArray[9].toNumber(),
};
}
}
Expand Down Expand Up @@ -1370,6 +1371,7 @@ export interface GenesisProtocolProposal {
* in seconds
*/
currentBoostedVotePeriodLimit: number;
daoBountyRemain: BigNumber.BigNumber;
executable: Address;
lostReputation: BigNumber.BigNumber;
numOfChoices: number;
Expand Down
5 changes: 5 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ pages:
- ProposalService : 'api/classes/ProposalService.md'
- PubSubEventService : 'api/classes/PubSubEventService.md'
- SchemeRegistrarWrapper : 'api/classes/SchemeRegistrarWrapper.md'
- StandardTokenFactoryType : 'api/classes/StandardTokenFactoryType.md'
- StandardTokenWrapper : 'api/classes/StandardTokenWrapper.md'
- SubscriptionCollection : 'api/classes/SubscriptionCollection.md'
- TokenCapGCWrapper : 'api/classes/TokenCapGCWrapper.md'
- TransactionService : 'api/classes/TransactionService.md'
Expand Down Expand Up @@ -97,6 +99,7 @@ pages:
- AgreementCancelEventResult : 'api/interfaces/AgreementCancelEventResult.md'
- AgreementProposal : 'api/interfaces/AgreementProposal.md'
- AgreementProposalEventResult : 'api/interfaces/AgreementProposalEventResult.md'
- ApprovalEventResult : 'api/interfaces/ApprovalEventResult.md'
- ArcWrapperFactories : 'api/interfaces/ArcWrapperFactories.md'
- ArcWrappers : 'api/interfaces/ArcWrappers.md'
- ArcWrappersByType : 'api/interfaces/ArcWrappersByType.md'
Expand Down Expand Up @@ -210,6 +213,8 @@ pages:
- StakeConfig : 'api/interfaces/StakeConfig.md'
- StakeEventResult : 'api/interfaces/StakeEventResult.md'
- StandardSchemeParams : 'api/interfaces/StandardSchemeParams.md'
- StandardTokenApproveOptions : 'api/interfaces/StandardTokenApproveOptions.md'
- StandardTokenParams : 'api/interfaces/StandardTokenParams.md'
- TokenCapGcParams : 'api/interfaces/TokenCapGcParams.md'
- TransactionReceiptsEventInfo : 'api/interfaces/TransactionReceiptsEventInfo.md'
- TransactionReceiptTruffle : 'api/interfaces/TransactionReceiptTruffle.md'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daostack/arc.js",
"version": "0.0.0-alpha.62",
"version": "0.0.0-alpha.63",
"description": "A JavaScript library for interacting with @daostack/arc ethereum smart contracts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions test/genesisProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
GenesisProtocolProposal,
GenesisProtocolWrapper,
GetDefaultGenesisProtocolParameters,
ProposalState,
} from "../lib/wrappers/genesisProtocol";
import { SchemeRegistrarFactory, SchemeRegistrarWrapper } from "../lib/wrappers/schemeRegistrar";
import { WrapperService } from "../lib/wrapperService";
Expand Down Expand Up @@ -161,6 +162,7 @@ describe("GenesisProtocol", () => {
"proposalId2 not found");

assert(typeof proposals[0].numOfChoices === "number");
assert.equal(proposals[0].state, ProposalState.PreBoosted, "state is wrong");
});

it("can get executed proposals", async () => {
Expand Down Expand Up @@ -190,6 +192,7 @@ describe("GenesisProtocol", () => {
assert(proposals[0].proposalId === proposalId2, "proposalId2 not found");
assert.isOk(proposals[0].totalReputation, "totalReputation not set properly on proposal");
assert.equal(proposals[0].decision, 1, "decision is wrong");
assert.equal(proposals[0].state, ProposalState.Executed, "state is wrong");
});

it("scheme can use GenesisProtocol", async () => {
Expand Down

0 comments on commit 285bec0

Please sign in to comment.