Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const assert = require('assert');
- const ganache = require('ganache-cli');
- const Web3 = require('web3');
- const provider = ganache.provider();
- const web3 = new Web3(provider);
- const { interface, bytecode } = require('../compile');
- let lottery;
- let accounts;
- beforeEach(async()=>{
- //Get list of all accounts
- accounts = await web3.eth.getAccounts();
- //Use one of those accounts to deploy
- //the contract
- lottery = await new web3.eth.Contract(JSON.parse(interface))
- .deploy({data: bytecode })
- .send({from: accounts[0], gas:'1000000'});
- lottery.setProvider(provider);
- });
- describe ('Lottery Contract', ()=> {
- it('deploys a contract',()=>{
- // console.log(accounts);
- //console.log(inbox.options.address);
- //console.log(inbox);
- assert.ok(lottery.options.address);
- });
- /*
- it('has a default message', async()=> {
- const message = await inbox.methods.message().call();
- assert.equal(message, 'Hi There!');
- });
- it('can change the message', async()=> {
- await inbox.methods.setMessage('bye').send({ from: accounts[0]});
- const message = await inbox.methods.message().call();
- assert.equal(message, 'bye');
- });
- */
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement