mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-12 14:54:57 +00:00
Merge pull request #369 from embark-framework/features/mapping-urls
Add new mappings for Solidity (HTTP and Github)
This commit is contained in:
commit
849e34a16b
@ -6,7 +6,8 @@
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2017
|
||||
},
|
||||
"rules": {
|
||||
"accessor-pairs": "error",
|
||||
|
@ -1,8 +1,10 @@
|
||||
var fs = require('./fs.js');
|
||||
var File = require('./file.js');
|
||||
var Plugins = require('./plugins.js');
|
||||
var utils = require('../utils/utils.js');
|
||||
var path = require('path');
|
||||
const fs = require('./fs.js');
|
||||
const File = require('./file.js');
|
||||
const Plugins = require('./plugins.js');
|
||||
const utils = require('../utils/utils.js');
|
||||
const path = require('path');
|
||||
|
||||
const httpContractDir = '.embark/contracts/';
|
||||
|
||||
var Config = function(options) {
|
||||
this.env = options.env;
|
||||
@ -142,6 +144,43 @@ Config.prototype.loadContractsConfigFile = function() {
|
||||
this.contractsConfig = this._mergeConfig(configFilePath, configObject, this.env);
|
||||
};
|
||||
|
||||
Config.prototype.getExternalContractUrl = function (contract) {
|
||||
let url;
|
||||
const RAW_URL = 'https://raw.githubusercontent.com/';
|
||||
const MALFORMED_ERROR = 'Malformed Github URL for ';
|
||||
if (contract.file.startsWith('https://github')) {
|
||||
const match = contract.file.match(/https:\/\/github\.[a-z]+\/(.*)/);
|
||||
if (!match) {
|
||||
this.logger.error(MALFORMED_ERROR + contract.file);
|
||||
return '';
|
||||
}
|
||||
url = `${RAW_URL}${match[1].replace('blob/', '')}`;
|
||||
} else if (contract.file.startsWith('git')) {
|
||||
// Match values
|
||||
// [0] entire input
|
||||
// [1] git://
|
||||
// [2] user
|
||||
// [3] repository
|
||||
// [4] path
|
||||
// [5] branch
|
||||
const match = contract.file.match(
|
||||
/(git:\/\/)?github\.[a-z]+\/([a-zA-Z0-9_\-.]+)\/([a-zA-Z0-9_\-7]+)\/([a-zA-Z0-9_\-\/.]+)#?([a-zA-Z0-1_\-.]*)?/
|
||||
);
|
||||
if (!match) {
|
||||
this.logger.error(MALFORMED_ERROR + contract.file);
|
||||
return '';
|
||||
}
|
||||
let branch = match[5];
|
||||
if (!branch) {
|
||||
branch = 'master';
|
||||
}
|
||||
url = `${RAW_URL}${match[2]}/${match[3]}/${branch}/${match[4]}`;
|
||||
} else {
|
||||
url = contract.file;
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
Config.prototype.loadExternalContractsFiles = function() {
|
||||
let contracts = this.contractsConfig.contracts;
|
||||
for (let contractName in contracts) {
|
||||
@ -149,10 +188,14 @@ Config.prototype.loadExternalContractsFiles = function() {
|
||||
if (!contract.file) {
|
||||
continue;
|
||||
}
|
||||
if (fs.existsSync(contract.file)) {
|
||||
this.contractsFiles.push(new File({filename: contract.file, type: "dapp_file", basedir: '', path: contract.file}));
|
||||
if (contract.file.startsWith('http') || contract.file.startsWith('git')) {
|
||||
const url = this.getExternalContractUrl(contract);
|
||||
const localFile = httpContractDir + path.basename(url);
|
||||
this.contractsFiles.push(new File({filename: localFile, type: File.types.http, basedir: '', path: url}));
|
||||
} else if (fs.existsSync(contract.file)) {
|
||||
this.contractsFiles.push(new File({filename: contract.file, type: File.types.dapp_file, basedir: '', path: contract.file}));
|
||||
} else if (fs.existsSync(path.join('./node_modules/', contract.file))) {
|
||||
this.contractsFiles.push(new File({filename: path.join('./node_modules/', contract.file), type: "dapp_file", basedir: '', path: path.join('./node_modules/', contract.file)}));
|
||||
this.contractsFiles.push(new File({filename: path.join('./node_modules/', contract.file), type: File.types.dapp_file, basedir: '', path: path.join('./node_modules/', contract.file)}));
|
||||
} else {
|
||||
this.logger.error("contract file not found: " + contract.file);
|
||||
}
|
||||
@ -216,6 +259,7 @@ Config.prototype.loadEmbarkConfigFile = function() {
|
||||
}).map((dir) => {
|
||||
return dir.split("*.")[0];
|
||||
});
|
||||
this.contractDirectories.push(httpContractDir);
|
||||
|
||||
this.buildDir = this.embarkConfig.buildDir;
|
||||
this.configDir = this.embarkConfig.config;
|
||||
@ -258,7 +302,7 @@ Config.prototype.loadFiles = function(files) {
|
||||
return (file[0] === '$' || file.indexOf('.') >= 0);
|
||||
}).filter(function(file) {
|
||||
let basedir = findMatchingExpression(file, files);
|
||||
readFiles.push(new File({filename: file, type: "dapp_file", basedir: basedir, path: file}));
|
||||
readFiles.push(new File({filename: file, type: File.types.dapp_file, basedir: basedir, path: file}));
|
||||
});
|
||||
|
||||
var filesFromPlugins = [];
|
||||
@ -291,7 +335,7 @@ Config.prototype.loadPluginContractFiles = function() {
|
||||
contractsPlugins.forEach(function(plugin) {
|
||||
plugin.contractsFiles.forEach(function(file) {
|
||||
var filename = file.replace('./','');
|
||||
self.contractsFiles.push(new File({filename: filename, type: 'custom', resolver: function(callback) {
|
||||
self.contractsFiles.push(new File({filename: filename, type: File.types.custom, resolver: function(callback) {
|
||||
callback(plugin.loadPluginFile(file));
|
||||
}}));
|
||||
});
|
||||
|
@ -1,8 +1,11 @@
|
||||
let fs = require('./fs.js');
|
||||
const async = require('async');
|
||||
const fs = require('./fs.js');
|
||||
const path = require('path');
|
||||
const request = require('request');
|
||||
|
||||
class File {
|
||||
|
||||
constructor(options) {
|
||||
constructor (options) {
|
||||
this.filename = options.filename;
|
||||
this.type = options.type;
|
||||
this.path = options.path;
|
||||
@ -10,13 +13,53 @@ class File {
|
||||
this.resolver = options.resolver;
|
||||
}
|
||||
|
||||
content(callback) {
|
||||
if (this.type === 'embark_internal') {
|
||||
downloadFile (callback) {
|
||||
const self = this;
|
||||
async.waterfall([
|
||||
function makeTheDir(next) {
|
||||
fs.mkdirp(path.dirname(self.filename), (err) => {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
next();
|
||||
});
|
||||
},
|
||||
function downloadTheFile(next) {
|
||||
request(self.path)
|
||||
.on('response', function (response) {
|
||||
if (response.statusCode !== 200) {
|
||||
next('Getting file returned code ' + response.statusCode);
|
||||
}
|
||||
})
|
||||
.on('error', next)
|
||||
.pipe(fs.createWriteStream(self.filename))
|
||||
.on('finish', () => {
|
||||
self.path = self.filename;
|
||||
self.type = File.types.dapp_file;
|
||||
next();
|
||||
});
|
||||
},
|
||||
function readFile(next) {
|
||||
fs.readFile(self.path, next);
|
||||
}
|
||||
], (err, content) => {
|
||||
if (err) {
|
||||
console.error('Error while downloading the file', err);
|
||||
return callback('');
|
||||
}
|
||||
callback(content.toString());
|
||||
});
|
||||
}
|
||||
|
||||
content (callback) {
|
||||
if (this.type === File.types.embark_internal) {
|
||||
return callback(fs.readFileSync(fs.embarkPath(this.path)).toString());
|
||||
} else if (this.type === 'dapp_file') {
|
||||
} else if (this.type === File.types.dapp_file) {
|
||||
return callback(fs.readFileSync(this.path).toString());
|
||||
} else if (this.type === 'custom') {
|
||||
} else if (this.type === File.types.custom) {
|
||||
return this.resolver(callback);
|
||||
} else if (this.type === File.types.http) {
|
||||
this.downloadFile(callback);
|
||||
} else {
|
||||
throw new Error("unknown file: " + this.filename);
|
||||
}
|
||||
@ -24,4 +67,11 @@ class File {
|
||||
|
||||
}
|
||||
|
||||
File.types = {
|
||||
embark_internal: 'embark_internal',
|
||||
dapp_file: 'dapp_file',
|
||||
custom: 'custom',
|
||||
http: 'http'
|
||||
};
|
||||
|
||||
module.exports = File;
|
||||
|
@ -7,6 +7,10 @@ function mkdirpSync() {
|
||||
return fs.mkdirpSync.apply(fs.mkdirpSync, arguments);
|
||||
}
|
||||
|
||||
function mkdirp() {
|
||||
return fs.mkdirp.apply(fs.mkdirp, arguments);
|
||||
}
|
||||
|
||||
function copySync() {
|
||||
return fs.copySync.apply(fs.copySync, arguments);
|
||||
}
|
||||
@ -19,6 +23,10 @@ function writeFileSync() {
|
||||
return fs.writeFileSync.apply(fs.writeFileSync, arguments);
|
||||
}
|
||||
|
||||
function readFile() {
|
||||
return fs.readFile.apply(fs.readFile, arguments);
|
||||
}
|
||||
|
||||
function readFileSync() {
|
||||
return fs.readFileSync.apply(fs.readFileSync, arguments);
|
||||
}
|
||||
@ -54,9 +62,15 @@ function dappPath() {
|
||||
return utils.joinPath(utils.pwd(), ...arguments);
|
||||
}
|
||||
|
||||
function createWriteStream() {
|
||||
return fs.createWriteStream.apply(fs.createWriteStream, arguments);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
mkdirpSync: mkdirpSync,
|
||||
mkdirp,
|
||||
copySync: copySync,
|
||||
readFile,
|
||||
readFileSync: readFileSync,
|
||||
appendFileSync: appendFileSync,
|
||||
writeFileSync: writeFileSync,
|
||||
@ -65,5 +79,6 @@ module.exports = {
|
||||
existsSync: existsSync,
|
||||
removeSync: removeSync,
|
||||
embarkPath: embarkPath,
|
||||
dappPath: dappPath
|
||||
dappPath: dappPath,
|
||||
createWriteStream
|
||||
};
|
||||
|
@ -27,6 +27,10 @@ class Solidity {
|
||||
}
|
||||
|
||||
file.content(function(fileContent) {
|
||||
if (!fileContent) {
|
||||
self.logger.error('Error while loading the content of ' + filename);
|
||||
return fileCb();
|
||||
}
|
||||
input[filename] = {content: fileContent.replace(/\r\n/g, '\n')};
|
||||
fileCb();
|
||||
});
|
||||
|
@ -1,12 +1,12 @@
|
||||
var utils = require('../utils/utils.js');
|
||||
const utils = require('../utils/utils.js');
|
||||
|
||||
module.exports = {
|
||||
run: function(filepath) {
|
||||
var Mocha = require('mocha'),
|
||||
fs = require('fs'),
|
||||
const Mocha = require('mocha'),
|
||||
fs = require('fs-extra'),
|
||||
path = require('path');
|
||||
|
||||
var mocha = new Mocha();
|
||||
const mocha = new Mocha();
|
||||
|
||||
if (filepath) {
|
||||
if (filepath.substr(-1) === '/') {
|
||||
@ -60,11 +60,14 @@ module.exports = {
|
||||
};
|
||||
|
||||
// Run the tests.
|
||||
let runner = mocha.run(function(failures){
|
||||
process.on('exit', function () {
|
||||
process.exit(failures); // exit with non-zero status if there were failures
|
||||
let runner = mocha.run(function(failures) {
|
||||
// Clean contracts folder for next test run
|
||||
fs.remove('.embark/contracts', (_err) => {
|
||||
process.on('exit', function () {
|
||||
process.exit(failures); // exit with non-zero status if there were failures
|
||||
});
|
||||
process.exit();
|
||||
});
|
||||
process.exit();
|
||||
});
|
||||
|
||||
runner.on('suite', function() {
|
||||
|
639
package-lock.json
generated
639
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -24,11 +24,11 @@
|
||||
"async": "^2.0.1",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-webpack-aliases": "^1.1.3",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-preset-es2016": "^6.24.1",
|
||||
"babel-preset-es2017": "6.24.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babel-plugin-webpack-aliases": "^1.1.3",
|
||||
"blessed": "^0.1.81",
|
||||
"chokidar": "^1.6.0",
|
||||
"colors": "^1.1.2",
|
||||
@ -49,6 +49,7 @@
|
||||
"parse-json": "^4.0.0",
|
||||
"promptly": "^2.1.0",
|
||||
"propose": "0.0.5",
|
||||
"request": "^2.85.0",
|
||||
"serve-static": "^1.11.1",
|
||||
"shelljs": "^0.5.0",
|
||||
"solc": "0.4.17",
|
||||
|
@ -5,7 +5,7 @@ let File = require('../lib/core/file.js');
|
||||
let assert = require('assert');
|
||||
|
||||
let readFile = function(file) {
|
||||
return new File({filename: file, type: 'dapp_file', path: file});
|
||||
return new File({filename: file, type: File.types.dapp_file, path: file});
|
||||
};
|
||||
|
||||
var solcVersion = "0.4.17";
|
||||
|
156
test/config.js
156
test/config.js
@ -1,17 +1,19 @@
|
||||
/*globals describe, it*/
|
||||
let Config = require('../lib/core/config.js');
|
||||
let Plugins = require('../lib/core/plugins.js');
|
||||
let assert = require('assert');
|
||||
const Config = require('../lib/core/config.js');
|
||||
const Plugins = require('../lib/core/plugins.js');
|
||||
const assert = require('assert');
|
||||
const TestLogger = require('../lib/tests/test_logger.js');
|
||||
|
||||
describe('embark.Config', function() {
|
||||
describe('embark.Config', function () {
|
||||
let config = new Config({
|
||||
env: 'myenv',
|
||||
configDir: './test/test1/config/'
|
||||
});
|
||||
config.plugins = new Plugins({plugins: {}});
|
||||
config.logger = new TestLogger({});
|
||||
|
||||
describe('#loadBlockchainConfigFile', function() {
|
||||
it('should load blockchain config correctly', function() {
|
||||
describe('#loadBlockchainConfigFile', function () {
|
||||
it('should load blockchain config correctly', function () {
|
||||
config.loadBlockchainConfigFile();
|
||||
let expectedConfig = {
|
||||
"enabled": true,
|
||||
@ -32,31 +34,129 @@ describe('embark.Config', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#loadContractsConfigFile', function() {
|
||||
it('should load contract config correctly', function() {
|
||||
config.loadContractsConfigFile();
|
||||
let expectedConfig = {
|
||||
versions: { 'web3.js': '1.0.0-beta', solc: '0.4.17' },
|
||||
deployment: { host: 'localhost', port: 8545, type: 'rpc' },
|
||||
dappConnection: [ '$WEB3', 'localhost:8545' ],
|
||||
"gas": "auto",
|
||||
"contracts": {
|
||||
"SimpleStorage": {
|
||||
"args": [
|
||||
100
|
||||
],
|
||||
"gas": 123456
|
||||
},
|
||||
"Token": {
|
||||
"args": [
|
||||
200
|
||||
]
|
||||
}
|
||||
describe('#loadContractsConfigFile', function () {
|
||||
it('should load contract config correctly', function () {
|
||||
config.loadContractsConfigFile();
|
||||
let expectedConfig = {
|
||||
versions: {'web3.js': '1.0.0-beta', solc: '0.4.17'},
|
||||
deployment: {host: 'localhost', port: 8545, type: 'rpc'},
|
||||
dappConnection: ['$WEB3', 'localhost:8545'],
|
||||
"gas": "auto",
|
||||
"contracts": {
|
||||
"SimpleStorage": {
|
||||
"args": [100],
|
||||
"gas": 123456
|
||||
},
|
||||
"Token": {
|
||||
"args": [200]
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
assert.deepEqual(config.contractsConfig, expectedConfig);
|
||||
assert.deepEqual(config.contractsConfig, expectedConfig);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getExternalContractUrl', function () {
|
||||
it('should get the right url for a https://github file', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'https://github.com/embark-framework/embark/blob/master/test_app/app/contracts/simple_storage.sol'}
|
||||
);
|
||||
assert.strictEqual(url,
|
||||
'https://raw.githubusercontent.com/embark-framework/embark/master/test_app/app/contracts/simple_storage.sol');
|
||||
});
|
||||
|
||||
it('should fail for a malformed https://github file', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'https://github/embark-framework/embark/blob/master/test_app/app/contracts/simple_storage.sol'}
|
||||
);
|
||||
assert.strictEqual(url, '');
|
||||
});
|
||||
|
||||
it('should get the right url for a git:// file with no branch #', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'git://github.com/status-im/contracts/contracts/identity/ERC725.sol'}
|
||||
);
|
||||
console.log(url);
|
||||
assert.strictEqual(url,
|
||||
'https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol');
|
||||
});
|
||||
|
||||
it('should get the right url for a git:// file with a branch #', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'git://github.com/status-im/contracts/contracts/identity/ERC725.sol#myBranch'}
|
||||
);
|
||||
assert.strictEqual(url,
|
||||
'https://raw.githubusercontent.com/status-im/contracts/myBranch/contracts/identity/ERC725.sol');
|
||||
});
|
||||
|
||||
it('should fail when the git:// file is malformed', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'git://github.com/identity/ERC725.sol#myBranch'}
|
||||
);
|
||||
assert.strictEqual(url, '');
|
||||
});
|
||||
|
||||
it('should get the right url with a github.com file without branch #', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'github.com/status-im/contracts/contracts/identity/ERC725.sol'}
|
||||
);
|
||||
assert.strictEqual(url,
|
||||
'https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol');
|
||||
});
|
||||
|
||||
it('should get the right url with a github.com file with branch #', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'github.com/status-im/contracts/contracts/identity/ERC725.sol#theBranch'}
|
||||
);
|
||||
assert.strictEqual(url,
|
||||
'https://raw.githubusercontent.com/status-im/contracts/theBranch/contracts/identity/ERC725.sol');
|
||||
});
|
||||
|
||||
it('should fail with a malformed github.com url', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'github/status-im/contracts/contracts/identity/ERC725.sol#theBranch'}
|
||||
);
|
||||
assert.strictEqual(url, '');
|
||||
});
|
||||
|
||||
it('should succeed with a generic http url', function () {
|
||||
const url = config.getExternalContractUrl(
|
||||
{file: 'http://myurl.com/myFile.sol'}
|
||||
);
|
||||
assert.strictEqual(url, 'http://myurl.com/myFile.sol');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#loadExternalContractsFiles', function () {
|
||||
it('should create the right list of files and download', function () {
|
||||
config.contractsFiles = [];
|
||||
config.contractsConfig.contracts = [
|
||||
{
|
||||
file: 'https://github.com/embark-framework/embark/blob/master/test_app/app/contracts/simple_storage.sol'
|
||||
},
|
||||
{
|
||||
file: 'github.com/status-im/contracts/contracts/identity/ERC725.sol'
|
||||
}
|
||||
];
|
||||
const expected = [
|
||||
{
|
||||
"filename": ".embark/contracts/simple_storage.sol",
|
||||
"type": "http",
|
||||
"path": "https://raw.githubusercontent.com/embark-framework/embark/master/test_app/app/contracts/simple_storage.sol",
|
||||
"basedir": "",
|
||||
"resolver": undefined
|
||||
},
|
||||
{
|
||||
"filename": ".embark/contracts/ERC725.sol",
|
||||
"type": "http",
|
||||
"path": "https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol",
|
||||
"basedir": "",
|
||||
"resolver": undefined
|
||||
}
|
||||
];
|
||||
config.loadExternalContractsFiles();
|
||||
assert.deepEqual(config.contractsFiles, expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -4,13 +4,12 @@ let Logger = require('../lib/core/logger.js');
|
||||
let File = require('../lib/core/file.js');
|
||||
let TestLogger = require('../lib/tests/test_logger.js');
|
||||
let assert = require('assert');
|
||||
let fs = require('fs');
|
||||
|
||||
//let SolidityCompiler = require('../lib/modules/solidity');
|
||||
let Plugins = require('../lib/core/plugins.js');
|
||||
|
||||
let readFile = function(file) {
|
||||
return new File({filename: file, type: 'dapp_file', path: file});
|
||||
return new File({filename: file, type: File.types.dapp_file, path: file});
|
||||
};
|
||||
|
||||
describe('embark.Contracts', function() {
|
||||
|
@ -71,6 +71,9 @@
|
||||
"args": [
|
||||
1000
|
||||
]
|
||||
},
|
||||
"ERC725": {
|
||||
"file": "https://github.com/status-im/contracts/blob/master/contracts/identity/ERC725.sol"
|
||||
}
|
||||
},
|
||||
"afterDeploy": [
|
||||
|
70
test_apps/test_app/package-lock.json
generated
70
test_apps/test_app/package-lock.json
generated
@ -48,6 +48,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"bn.js": {
|
||||
"version": "4.11.6",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
|
||||
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
|
||||
},
|
||||
"bootstrap": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz",
|
||||
@ -84,7 +89,12 @@
|
||||
"dom-helpers": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.3.1.tgz",
|
||||
"integrity": "sha512-2Sm+JaYn74OiTM2wHvxJOo3roiq/h25Yi69Fqk269cNUwIXsCvATB6CRSFC9Am/20G2b28hGv/+7NiWydIrPvg=="
|
||||
"integrity": "sha1-/BpOFf/fYN3eA6SAqcD+zoId1KY="
|
||||
},
|
||||
"dotenv": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz",
|
||||
"integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0="
|
||||
},
|
||||
"embark-service": {
|
||||
"version": "file:extensions/embark-service",
|
||||
@ -118,6 +128,16 @@
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
||||
"dev": true
|
||||
},
|
||||
"ethjs-abi": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.1.tgz",
|
||||
"integrity": "sha1-4KepOn6BFjqUR3utVu3lJKtt5TM=",
|
||||
"requires": {
|
||||
"bn.js": "4.11.6",
|
||||
"js-sha3": "0.5.5",
|
||||
"number-to-bn": "1.7.0"
|
||||
}
|
||||
},
|
||||
"fbjs": {
|
||||
"version": "0.8.16",
|
||||
"resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz",
|
||||
@ -154,6 +174,11 @@
|
||||
"loose-envify": "1.3.1"
|
||||
}
|
||||
},
|
||||
"is-hex-prefixed": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz",
|
||||
"integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
@ -173,6 +198,11 @@
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-1.12.4.tgz",
|
||||
"integrity": "sha1-AeHfuikP5z3rp3zurLD5ui/sngw="
|
||||
},
|
||||
"js-sha3": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz",
|
||||
"integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko="
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
|
||||
@ -194,12 +224,21 @@
|
||||
"node-fetch": {
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
|
||||
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
|
||||
"integrity": "sha1-mA9vcthSEaU0fGsrwYxbhMPrR+8=",
|
||||
"requires": {
|
||||
"encoding": "0.1.12",
|
||||
"is-stream": "1.1.0"
|
||||
}
|
||||
},
|
||||
"number-to-bn": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz",
|
||||
"integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=",
|
||||
"requires": {
|
||||
"bn.js": "4.11.6",
|
||||
"strip-hex-prefix": "1.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
@ -208,7 +247,7 @@
|
||||
"promise": {
|
||||
"version": "7.3.1",
|
||||
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
|
||||
"integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
|
||||
"integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=",
|
||||
"requires": {
|
||||
"asap": "2.0.6"
|
||||
}
|
||||
@ -245,7 +284,7 @@
|
||||
"react-bootstrap": {
|
||||
"version": "0.32.1",
|
||||
"resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-0.32.1.tgz",
|
||||
"integrity": "sha512-RbfzKUbsukWsToWqGHfCCyMFq9QQI0TznutdyxyJw6dih2NvIne25Mrssg8LZsprqtPpyQi8bN0L0Fx3fUsL8Q==",
|
||||
"integrity": "sha1-YGJMG0ijnXc+9szmQhpPM+zBZrs=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.26.0",
|
||||
"classnames": "2.2.5",
|
||||
@ -275,7 +314,7 @@
|
||||
"react-overlays": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-0.8.3.tgz",
|
||||
"integrity": "sha512-h6GT3jgy90PgctleP39Yu3eK1v9vaJAW73GOA/UbN9dJ7aAN4BTZD6793eI1D5U+ukMk17qiqN/wl3diK1Z5LA==",
|
||||
"integrity": "sha1-+tZe6lskMBzKGSoWn13dsLINOsU=",
|
||||
"requires": {
|
||||
"classnames": "2.2.5",
|
||||
"dom-helpers": "3.3.1",
|
||||
@ -309,7 +348,7 @@
|
||||
"regenerator-runtime": {
|
||||
"version": "0.11.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
|
||||
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
|
||||
"integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk="
|
||||
},
|
||||
"setimmediate": {
|
||||
"version": "1.0.5",
|
||||
@ -325,6 +364,14 @@
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
},
|
||||
"strip-hex-prefix": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz",
|
||||
"integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=",
|
||||
"requires": {
|
||||
"is-hex-prefixed": "1.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
@ -334,7 +381,7 @@
|
||||
"ua-parser-js": {
|
||||
"version": "0.7.17",
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz",
|
||||
"integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g=="
|
||||
"integrity": "sha1-6exflJi57JEOeuOsYmqAXE0J7Kw="
|
||||
},
|
||||
"uncontrollable": {
|
||||
"version": "4.1.0",
|
||||
@ -356,6 +403,15 @@
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz",
|
||||
"integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ="
|
||||
},
|
||||
"zeppelin-solidity": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/zeppelin-solidity/-/zeppelin-solidity-1.8.0.tgz",
|
||||
"integrity": "sha1-BJ/N59rqn8hSEPjG25+M0auKhTo=",
|
||||
"requires": {
|
||||
"dotenv": "4.0.0",
|
||||
"ethjs-abi": "0.2.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
18
test_apps/test_app/test/http_contract_test.js
Normal file
18
test_apps/test_app/test/http_contract_test.js
Normal file
@ -0,0 +1,18 @@
|
||||
/*globals describe, it*/
|
||||
const fs = require('fs-extra');
|
||||
const assert = require('assert');
|
||||
|
||||
describe('http contracts', () => {
|
||||
describe('ERC725', () => {
|
||||
const contractPath = '.embark/contracts/ERC725.sol';
|
||||
|
||||
it('should have downloaded the file in .embark/contracts', (done) => {
|
||||
fs.access(contractPath, (err) => {
|
||||
if (err) {
|
||||
assert.fail(contractPath + ' was not downloaded');
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,3 +1,4 @@
|
||||
/*global describe, it, before*/
|
||||
|
||||
describe("Token", function() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user