mirror of https://github.com/embarklabs/embark.git
tdd integration poc
This commit is contained in:
parent
885651c893
commit
0af68cbc9c
|
@ -10,7 +10,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"embark-framework": "^0.3.0",
|
"embark-framework": "/Users/iurimatias/Projects/embark-framework",
|
||||||
"grunt-contrib-clean": "^0.6.0",
|
"grunt-contrib-clean": "^0.6.0",
|
||||||
"grunt-contrib-coffee": "^0.13.0",
|
"grunt-contrib-coffee": "^0.13.0",
|
||||||
"grunt-contrib-concat": "^0.5.1",
|
"grunt-contrib-concat": "^0.5.1",
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-cli": "^0.1.13",
|
"grunt-cli": "^0.1.13",
|
||||||
"matchdep": "^0.3.0"
|
"matchdep": "^0.3.0",
|
||||||
|
"python": "^0.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
EmbarkSpec = require("embark-framework").specs();
|
||||||
|
|
||||||
|
SimpleStorage = EmbarkSpec.SimpleStorage;
|
||||||
|
|
||||||
|
SimpleStorage.set(100);
|
||||||
|
|
||||||
|
a = SimpleStorage.get()
|
||||||
|
console.log(a)
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
var python = require('python').shell;
|
||||||
|
var web3 = require('web3');
|
||||||
|
|
||||||
|
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));
|
||||||
|
web3.eth.defaultAccount = web3.eth.accounts[0];
|
||||||
|
|
||||||
|
fs = require('fs');
|
||||||
|
source = fs.readFileSync('./app/contracts/simple_storage.sol').toString()
|
||||||
|
compiled_contracts = web3.eth.compile.solidity(source)
|
||||||
|
|
||||||
|
contract = compiled_contracts.SimpleStorage
|
||||||
|
|
||||||
|
example_abi = JSON.stringify(contract.info.abiDefinition)
|
||||||
|
example_binary = contract.code.slice(2)
|
||||||
|
|
||||||
|
python("from ethertdd import EvmContract", function() {})
|
||||||
|
python("example_abi = '" + example_abi + "'", function() {})
|
||||||
|
python("example_abi", function() { })
|
||||||
|
python("example_binary = '" + example_binary + "'.decode('hex')", function() {})
|
||||||
|
python("example_binary", function() { })
|
||||||
|
python("contract = EvmContract(example_abi, example_binary)", function() {})
|
||||||
|
python("contract.set(10)", function() {})
|
||||||
|
|
||||||
|
console.log("get")
|
||||||
|
python("contract.get()", function(err, data) { console.log("=>" + data)})
|
||||||
|
|
1
index.js
1
index.js
|
@ -7,4 +7,3 @@ var express = require('express');
|
||||||
var compression = require('compression');
|
var compression = require('compression');
|
||||||
var commander = require('commander');
|
var commander = require('commander');
|
||||||
var wrench = require('wrench');
|
var wrench = require('wrench');
|
||||||
console.log("dude!!!");
|
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
"embark": "./bin/embark"
|
"embark": "./bin/embark"
|
||||||
},
|
},
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
|
"directories": {
|
||||||
|
"lib": "./lib"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^2.8.1",
|
"commander": "^2.8.1",
|
||||||
"compression": "^1.4.3",
|
"compression": "^1.4.3",
|
||||||
|
@ -27,7 +30,8 @@
|
||||||
"shelljs": "^0.5.0",
|
"shelljs": "^0.5.0",
|
||||||
"web3": "^0.5.0",
|
"web3": "^0.5.0",
|
||||||
"wrench": "^1.5.8",
|
"wrench": "^1.5.8",
|
||||||
"hashmerge": "^1.0.2"
|
"hashmerge": "^1.0.2",
|
||||||
|
"python": "^0.0.4"
|
||||||
},
|
},
|
||||||
"author": "Iuri Matias <iuri.matias@gmail.com>",
|
"author": "Iuri Matias <iuri.matias@gmail.com>",
|
||||||
"contributors": [],
|
"contributors": [],
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
Loading…
Reference in New Issue