fix lint; update tests
This commit is contained in:
parent
273834ec39
commit
4d1368f388
|
@ -3,7 +3,7 @@
|
|||
<%- className %>.options.address = '<%- contract.deployedAddress %>';
|
||||
<%- className %>.address = '<%- contract.deployedAddress %>';
|
||||
<%- className %>.options.from = web3.eth.defaultAccount;
|
||||
if (<%- gasLimit %>) {
|
||||
<% if (gasLimit != false) { %>
|
||||
<%- className %>.options.gas = <%- gasLimit %>;
|
||||
<%- className %>.options.gasLimit = <%- gasLimit %>;
|
||||
}
|
||||
<% } %>
|
||||
|
|
|
@ -132,13 +132,11 @@ class Pipeline {
|
|||
exclude: /(node_modules|bower_components)/,
|
||||
options: {
|
||||
presets: ['es2016', 'es2017', 'react'],
|
||||
plugins: [
|
||||
"babel-plugin-webpack-aliases"
|
||||
]
|
||||
plugins: ["babel-plugin-webpack-aliases"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
}).run((_err, _stats) => {
|
||||
next();
|
||||
});
|
||||
|
@ -187,13 +185,11 @@ class Pipeline {
|
|||
exclude: /(node_modules|bower_components)/,
|
||||
options: {
|
||||
presets: ['es2016', 'es2017', 'react'],
|
||||
plugins: [
|
||||
"babel-plugin-webpack-aliases"
|
||||
]
|
||||
plugins: ["babel-plugin-webpack-aliases"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
}).run((_err, _stats) => {
|
||||
next();
|
||||
});
|
||||
|
|
|
@ -47,7 +47,7 @@ describe('embark.CodeGenerator', function() {
|
|||
let withEmbarkJS = false;
|
||||
|
||||
it('should generate contract code', function() {
|
||||
var contractCode = "\n__mainContext.__loadManagerInstance.execWhenReady(function() {\n SimpleStorageAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nSimpleStorage = new web3.eth.Contract(SimpleStorageAbi);\nSimpleStorage.options.address = '0x123';\nSimpleStorage.address = '0x123';\nSimpleStorage.options.from = web3.eth.defaultAccount;\n\n});\n__mainContext.__loadManagerInstance.execWhenReady(function() {\n FooAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nFoo = new web3.eth.Contract(FooAbi);\nFoo.options.address = '0x124';\nFoo.address = '0x124';\nFoo.options.from = web3.eth.defaultAccount;\n\n});\n";
|
||||
var contractCode = "\n__mainContext.__loadManagerInstance.execWhenReady(function() {\n SimpleStorageAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nSimpleStorage = new web3.eth.Contract(SimpleStorageAbi);\nSimpleStorage.options.address = '0x123';\nSimpleStorage.address = '0x123';\nSimpleStorage.options.from = web3.eth.defaultAccount;\n\n\n});\n__mainContext.__loadManagerInstance.execWhenReady(function() {\n FooAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nFoo = new web3.eth.Contract(FooAbi);\nFoo.options.address = '0x124';\nFoo.address = '0x124';\nFoo.options.from = web3.eth.defaultAccount;\n\n\n});\n";
|
||||
assert.equal(generator.generateContracts(withEmbarkJS), contractCode);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue