git ssb

0+

dangerousbeans / Entropy_contracts



Tree: be59af3f6ee21c7ed8efecaa9e4a6fd406639da1

Files: be59af3f6ee21c7ed8efecaa9e4a6fd406639da1 / test / Entropy_token.js

1078 bytesRaw
1const helpers = require('./helpers');
2
3contract('EntropyToken', (accounts) => {
4 describe("Basic", () => {
5 it("Sets valid attributes", function(done) {
6 helpers.deployEntropyContract()
7 .then((entropy) => {
8 helpers.callAndCheck( entropy, 'name', 'Entropy', 'Wrong name!')
9 helpers.callAndCheck( entropy, 'symbol', 'ENT', 'Wrong symbol!')
10 helpers.callAndCheck( entropy, 'totalSupply', 1, 'Wrong total supply!')
11 .then(() => {
12 done();
13 })
14 })
15 })
16 });
17
18 describe("Buying Entropy tokens", () => {
19 it("Lets you buy Entropy tokens", function(done) {
20 helpers.deployEntropyContract()
21 .then((entropy) => {
22 // Buy with 2 Eth worth of value
23 entropy.buyTokens({ from: accounts[1], value: 2e18 })
24 .then(() => {
25 entropy.balanceOf.call(accounts[1])
26 .then((balance) => {
27 console.log("BALANCE:::::")
28 console.log(balance)
29
30 assert.equal(balance.valueOf(), 2);
31 done();
32 })
33 })
34 })
35 })
36 })
37})
38

Built with git-ssb-web