-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Democracy #350
Democracy #350
Changes from all commits
aefc59f
4ad432d
ac9f108
e8e83a2
72c6313
e273c1a
057ba0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,6 +320,53 @@ def test_faucet(client, cid): | |
exit(1) | ||
print('Faucet closed', flush=True) | ||
|
||
|
||
def test_democracy(client, cid): | ||
print('Starting democracy test...') | ||
client.next_phase() | ||
client.next_phase() | ||
client.next_phase() | ||
#phase is 9, registering | ||
print(client.purge_community_ceremony(cid, 1, 8)) | ||
register_participants_and_perform_meetup(client, cid, accounts) | ||
cindex = 9 | ||
|
||
# registering of cindex 10 | ||
client.next_phase() | ||
|
||
claim_rewards(client, cid, "//Alice", pay_fees_in_cc=False) | ||
client.await_block(1) | ||
|
||
client.next_phase() | ||
client.next_phase() | ||
client.next_phase() | ||
# cindex is now 11 | ||
|
||
|
||
client.await_block(1) | ||
client.submit_set_inactivity_timeout_proposal("//Alice", 8) | ||
client.await_block(1) | ||
proposals = client.list_proposals() | ||
print(proposals) | ||
if('id: 1' not in proposals): | ||
print(f"Proposal Submission failed") | ||
exit(1) | ||
|
||
print('proposal submitted') | ||
# vote with all reputations gathered so far | ||
client.vote("//Alice", 1, "aye", [[cid, cindex]]) | ||
client.vote("//Bob", 1, "aye", [[cid, cindex]]) | ||
client.vote("//Charlie", 1, "aye", [[cid, cindex]]) | ||
|
||
|
||
client.await_block(21) | ||
client.update_proposal_state("//Alice", 1) | ||
proposals = client.list_proposals() | ||
print(proposals) | ||
if('Approved' not in proposals): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. within the same testing time we could test 3 parallel proposals to increase test coverage:
Moreover, it would be nice to test enactment too, not just approval There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure! now in the light of very limited time remaining from my side, where to put the focus? this, or the remaining tasks for the accounting dashboard? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated tracking issue accordningly |
||
print(f"Proposal Voting and Approval failed") | ||
exit(1) | ||
|
||
@click.command() | ||
@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') | ||
@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain.') | ||
|
@@ -331,6 +378,7 @@ def main(ipfs_local, client, url, port, spec_file, test): | |
client = Client(rust_client=client, node_url=url, port=port) | ||
cid = create_community(client, spec_file, ipfs_local) | ||
|
||
|
||
newbie = client.create_accounts(1)[0] | ||
faucet(client, cid, [account3, newbie]) | ||
|
||
|
@@ -386,6 +434,8 @@ def main(ipfs_local, client, url, port, spec_file, test): | |
|
||
test_endorsements_by_reputables(client, cid) | ||
|
||
test_democracy(client, cid) | ||
|
||
print("tests passed") | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's brittle. we should not assume the same order of tests forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is exactly why i have been saying for a long time that we need to refactor the integration tests :)