Skip to content

Commit

Permalink
feat/#63 fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvo11 committed Dec 10, 2020
1 parent 2c0921b commit 32961a1
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 119 deletions.
1 change: 1 addition & 0 deletions community/include/community.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ CONTRACT community : public contract
((v1.amenexec)(v1_sole_decision)(v1_amend_sole_decision_table))
((v1.filling)(v1_election_rule)(v1_election_table))
((v1.pproposal)(v1_pos_proposal)(v1_posproposal_table))
((v1.cproposal)(v1_code_proposal)(v1_code_proposals_table))
((v1.candidate)(v1_pos_candidate)(v1_poscandidate_table))
)
#endif
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest"
},
"dependencies": {
"@klevoya/hydra": "1.2.0",
"@klevoya/hydra": "1.2.2",
"jest": "^25.1.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions test/codeProposal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ describe("test create/vote/execute proposal", () => {
const executeProposalName = 'initproposal';

const serializeActionData = '8040f0d94d2d254500800819abac1245008042d3ccab36650200c2a42e2393b1ca00c4a42e2393b1ca';
// console.log('--------- governance contract: ', JSON.stringify(governanceContract.abi));
await governanceContract.loadFixtures(`v1.cproposal`, {
// scope: [row1, row2, ...],
'community1.c': [{
proposal_name: executeProposalName,
proposer: proposer.accountName,
Expand All @@ -391,8 +391,8 @@ describe("test create/vote/execute proposal", () => {
value: 1,
}],
proposal_status: 0,
propose_time: Date().toString(),
exec_at: Date().toString(),
propose_time: '2020-12-10T04:01:08', //new Date().toString(),
exec_at: '2020-12-10T04:01:08', //new Date().toString(),
}],
});
await expect(governanceContract.contract.execproposal({
Expand Down
54 changes: 53 additions & 1 deletion test/community/community.abi
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,34 @@
}
]
},
{
"name": "hydraload",
"base": "",
"fields": [
{
"name": "payload",
"type": "hydraload_payload[]"
}
]
},
{
"name": "hydraload_payload",
"base": "",
"fields": [
{
"name": "table_name",
"type": "name"
},
{
"name": "scope",
"type": "name"
},
{
"name": "row_data",
"type": "bytes"
}
]
},
{
"name": "initadminpos",
"base": "",
Expand Down Expand Up @@ -553,6 +581,20 @@
}
]
},
{
"name": "revokebadge",
"base": "",
"fields": [
{
"name": "community_account",
"type": "name"
},
{
"name": "revoke_badge_propose_name",
"type": "name"
}
]
},
{
"name": "setaccess",
"base": "",
Expand Down Expand Up @@ -1289,6 +1331,11 @@
"type": "execproposal",
"ricardian_contract": ""
},
{
"name": "hydraload",
"type": "hydraload",
"ricardian_contract": ""
},
{
"name": "initadminpos",
"type": "initadminpos",
Expand Down Expand Up @@ -1319,6 +1366,11 @@
"type": "proposecode",
"ricardian_contract": ""
},
{
"name": "revokebadge",
"type": "revokebadge",
"ricardian_contract": ""
},
{
"name": "setaccess",
"type": "setaccess",
Expand Down Expand Up @@ -1429,7 +1481,7 @@
"key_types": []
},
{
"name": "v1.cert",
"name": "v1.certs",
"type": "v1_cert",
"index_type": "i64",
"key_names": [],
Expand Down
Binary file modified test/community/community.wasm
Binary file not shown.
Loading

0 comments on commit 32961a1

Please sign in to comment.