-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
// contract test code will go here | ||
const assert = require('assert'); | ||
const ganache = require ('ganache-cli'); | ||
const Web3 = require('web3'); | ||
const web3 = new Web3(ganache.provider()); | ||
const { interface, bytecode} = require('../compile'); | ||
|
||
|
||
let accounts; | ||
let inbox; | ||
beforeEach(async () => { | ||
//Get a list of all accounts | ||
|
||
accounts = await web3.eth.getAccounts(); | ||
//User one of those account to deploy | ||
// the contract | ||
inbox = await new web3.eth.Contract(JSON.parse(interface)) | ||
.deploy({data: bytecode, arguments: ['Hi there!']}) | ||
.send({from: accounts[0],gas:1000000}); | ||
}); | ||
|
||
describe('Inbox',() => { | ||
it('should deploy the contract',()=> { | ||
console.log(inbox); | ||
}) | ||
}) |