mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 20:55:48 +00:00
Fix perf test
This commit is contained in:
@@ -47,9 +47,9 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "gulp",
|
"build": "gulp",
|
||||||
"clean": "rm -rf dist/npm && rm -rf build/flow",
|
"clean": "rm -rf dist/npm && rm -rf build/flow",
|
||||||
"typecheck": "babel -i runtime --blacklist flow -d build/flow/ src/ && flow",
|
"typecheck": "babel --optional runtime --blacklist flow -d build/flow/ src/ && flow",
|
||||||
"compile": "babel -i runtime -d dist/npm/ src/",
|
"compile": "babel --optional runtime -d dist/npm/ src/ && cp -r src/api/common/schemas/ dist/npm/api/common/schemas/",
|
||||||
"compile-with-source-maps": "babel -i runtime -s -t -d dist/npm/ src/",
|
"compile-with-source-maps": "babel --optional runtime -s -t -d dist/npm/ src/",
|
||||||
"prepublish": "npm run clean && npm run compile",
|
"prepublish": "npm run clean && npm run compile",
|
||||||
"test": "istanbul test _mocha",
|
"test": "istanbul test _mocha",
|
||||||
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var Amount = require('../dist/npm').Amount;
|
var Amount = require('../dist/npm').Amount;
|
||||||
var Ledger = require('../dist/npm/ledger').Ledger;
|
var Ledger = require('../dist/npm').Ledger;
|
||||||
|
|
||||||
function parse_options(from, flags) {
|
function parse_options(from, flags) {
|
||||||
var argv = from.slice(),
|
var argv = from.slice(),
|
||||||
|
|||||||
@@ -24,8 +24,12 @@ function loadSchema(filepath) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function endsWith(str, suffix) {
|
||||||
|
return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
||||||
|
}
|
||||||
|
|
||||||
function loadSchemas(dir) {
|
function loadSchemas(dir) {
|
||||||
const filenames = fs.readdirSync(dir).filter(name => name.endsWith('.json'));
|
const filenames = fs.readdirSync(dir).filter(name => endsWith(name, '.json'));
|
||||||
const schemas = filenames.map(name => loadSchema(path.join(dir, name)));
|
const schemas = filenames.map(name => loadSchema(path.join(dir, name)));
|
||||||
return _.indexBy(schemas, 'title');
|
return _.indexBy(schemas, 'title');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function getFeeDrops(remote) {
|
|||||||
return remote.feeTx(feeUnits).to_text();
|
return remote.feeTx(feeUnits).to_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*:: type Callback = (err: typeof Error, data: {tx_json: any}) => void */
|
/*:: type Callback = (err: ?(typeof Error), data: {tx_json: any}) => void */
|
||||||
function createTxJSON(transaction: any, remote: any,
|
function createTxJSON(transaction: any, remote: any,
|
||||||
instructions: any, callback: Callback): void {
|
instructions: any, callback: Callback): void {
|
||||||
common.validate.instructions(instructions);
|
common.validate.instructions(instructions);
|
||||||
|
|||||||
Reference in New Issue
Block a user