Skip to content

Commit

Permalink
project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
marekkirejczyk committed Jul 16, 2018
1 parent 9b52fd1 commit 2b3c8f9
Show file tree
Hide file tree
Showing 6 changed files with 5,022 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"presets": [
"env",
"stage-0"
],
"plugins": [
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
],
"env": {
"test": {
"sourceMaps": "inline",
"retainLines": true
}
}
}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
.idea
data
/build/
yarn-error.log
nodePrivateKey.json
registryContractAddress.json
/config/dev.json
8 changes: 8 additions & 0 deletions lib/waffle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Ganache from 'ganache-core';
import Web3 from 'web3';

export async function createWeb3() {
const web3 = new Web3();
web3.setProvider(Ganache.provider);
return {web3};
}
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Waffle",
"description": "Sweeter and simpler than truffle.",
"version": "0.0.1",
"author": "Marek Kirejczyk, Ethworks",
"repository": "[email protected]:EthWorks/Waffle.git",
"private": true,
"license": "MIT",
"scripts": {
"test": "export NODE_ENV=test && mocha --require babel-register --timeout 10000 --recursive --no-warnings"
},
"engines": {
"node": ">=9.0",
"yarn": ">=1.3.2 <2.0.0"
},
"dependencies": {
"web3": "^1.0.0-beta.34"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"ganache-core": "^2.1.0",
"mocha": "^5.1.1"
}
}
20 changes: 20 additions & 0 deletions test/waffle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {createWeb3} from '../lib/waffle'

chai.use(chaiAsPromised);

const {expect} = chai;

describe('Waffle', () => {
let web3;

beforeEach(async () => {
({web3} = await createWeb3());
});

it('createWeb3', async () => {
expect(web3.utils.randomHex(0)).to.eq('0x');
});

});
Loading

0 comments on commit 2b3c8f9

Please sign in to comment.