git ssb

0+

dangerousbeans / Entropy_contracts



Tree: 8c8b7da9dc43699fc6a0d49a9c8ba2ccf4075672

Files: 8c8b7da9dc43699fc6a0d49a9c8ba2ccf4075672 / test / Entropy_actions.js

1423 bytesRaw
1const helpers = require('./helpers');
2
3contract('Entropy - Actions', (accounts) => {
4 /**
5 * Actions
6 *
7 */
8
9 describe("Creating actions", () =>{
10 it("stops untrusted Citizens from creating actions", (done) => {
11 helpers.deployEntropyContract()
12 .then((entropy) => {
13 return helpers.expectedExceptionPromise(() => {
14 return entropy.newAction(1e18, "Rigging refit", { from: accounts[1]});
15 }, 3000000)
16 .then(()=>{
17 entropy.actions_count().then((actions_count) => {
18 assert.equal(actions_count, 0);
19 done();
20 })
21 })
22 })
23 });
24
25 it("lets trusted Citizens create actions", (done) => {
26 helpers.deployEntropyContract()
27 .then((entropy) => {
28 entropy.newAction(1e18, "Rigging refit").then((tx) => {
29 entropy.actions_count().then((actions_count) => {
30 assert.equal(actions_count, 1);
31 })
32 .then(()=>{ done() })
33 })
34 })
35 })
36 })
37
38 describe("Voting", () =>{
39 it("lets trusted citizens vote", (done) => {
40 helpers.deployEntropyContract()
41 .then((entropy) => {
42 entropy.newAction(1e18, "Rigging refit").then((tx) => {
43 entropy.actions_count().then((actions_count) => {
44 assert.equal(actions_count, 1);
45 })
46 .then(()=>{ done() })
47 })
48 })
49 });
50
51 })
52
53})
54

Built with git-ssb-web