/*global contract, config, it, assert*/ const Meritocracy = require('Embark/contracts/Meritocracy'); // const StandardToken = require('Embark/contracts/StandardToken'); const SNT = require('Embark/contracts/SNT'); let accounts; let owner; let admins; let ownerInitTokens; // For documentation please see https://embark.status.im/docs/contracts_testing.html config({ deployment: { accounts: [ { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, { "mnemonic": "12 word mnemonic", "balance": "5 ether" }, // you can configure custom accounts with a custom balance // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts ] }, contracts: { "MiniMeToken": { "deploy": false, "args" : [] }, "MiniMeTokenFactory": { }, "SNT": { "instanceOf": "MiniMeToken", "args": [ "$MiniMeTokenFactory", "0x0000000000000000000000000000000000000000", 0, "TestMiniMeToken", 18, "STT", true ] }, "Meritocracy": { "fromIndex": 0, // accounts[0] "args": ["$SNT", 10] // Bind to SNT Contract, max 10 contributors. } } }, (_err, web3_accounts) => { console.log('dsdsdsds'); accounts = web3_accounts; owner = accounts[0]; admins = [accounts[0], accounts[1], accounts[2]]; ownerInitTokens = 10000; }); contract("Meritocracy", function () { before(async () => { await SNT.methods.generateTokens(owner, ownerInitTokens).send(); }); // Owner Tests it("owned == owner, maxContributors == 10", async function () { var result; result = await Meritocracy.methods.owner().call(); assert.strictEqual(result, owner); result = await Meritocracy.methods.maxContributors().call(); assert.strictEqual(parseInt(result), 10); }); it("registry.length == 3, allocate(1000);", async function () { var result; let allocationAmount = 1000; let contributorCount = 3; let individualAllocation = parseInt(allocationAmount / contributorCount); // 333 // Add 3 Contibutors and check registry length matches var i = 0; while(i