Merge branch 'update-lodash' into develop

This commit is contained in:
Elliot Lee
2017-09-27 15:47:51 -07:00
12 changed files with 8566 additions and 117 deletions

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v6

View File

@@ -1,5 +1,14 @@
# ripple-lib Release History # ripple-lib Release History
## UNRELEASED
+ Update for Node 6
+ Update to use lodash 4
## 0.17.7 (2017-05-08)
+ Replace AJV with jsonschema
## 0.16.5 (2016-01-21) ## 0.16.5 (2016-01-21)
+ [Filter insufficient source funds paths from pathfind results](https://github.com/ripple/ripple-lib/pull/688) + [Filter insufficient source funds paths from pathfind results](https://github.com/ripple/ripple-lib/pull/688)

View File

@@ -1,11 +1,10 @@
machine: machine:
node: node:
version: 0.12.0 version: 6.11.3
hosts: hosts:
testripple.circleci.com: 127.0.0.1 testripple.circleci.com: 127.0.0.1
dependencies: dependencies:
pre: pre:
- npm -g install npm@latest-2
- wget https://s3-us-west-2.amazonaws.com/ripple-debs/rippled_0.30.1-b11-1.deb - wget https://s3-us-west-2.amazonaws.com/ripple-debs/rippled_0.30.1-b11-1.deb
- sudo dpkg -i rippled_0.30.1-b11-1.deb - sudo dpkg -i rippled_0.30.1-b11-1.deb
test: test:

View File

@@ -116,7 +116,7 @@ api.connect().then(() => {
}).catch(console.error); }).catch(console.error);
``` ```
RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.9.0** or later. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support. RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.11.3**. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support.
The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
@@ -155,7 +155,7 @@ If you omit the `server` parameter, RippleAPI operates [offline](#offline-functi
### Installation ### ### Installation ###
1. Install [Node.js](https://nodejs.org) and the Node Package Manager (npm). Most Linux distros have a package for Node.js, but make sure you have version **6.9.0** or higher. 1. Install [Node.js](https://nodejs.org) and the Node Package Manager (npm). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use npm to install RippleAPI: 2. Use npm to install RippleAPI:
`npm install ripple-lib` `npm install ripple-lib`

View File

@@ -26,7 +26,7 @@ api.connect().then(() => {
}).catch(console.error); }).catch(console.error);
``` ```
RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.9.0** or later. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support. RippleAPI is designed to work in [Node.js](https://nodejs.org) version **6.11.3**. RippleAPI may work on older Node.js versions if you use [Babel](https://babeljs.io/) for [ECMAScript 6](https://babeljs.io/docs/learn-es2015/) support.
The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). The code samples in this documentation are written with ECMAScript 6 (ES6) features, but `RippleAPI` also works with ECMAScript 5 (ES5). Regardless of whether you use ES5 or ES6, the methods that return Promises return [ES6-style promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
@@ -53,7 +53,7 @@ If you omit the `server` parameter, RippleAPI operates [offline](#offline-functi
### Installation ### ### Installation ###
1. Install [Node.js](https://nodejs.org) and the Node Package Manager (npm). Most Linux distros have a package for Node.js, but make sure you have version **6.9.0** or higher. 1. Install [Node.js](https://nodejs.org) and the Node Package Manager (npm). Most Linux distros have a package for Node.js; check that it's the version you want.
2. Use npm to install RippleAPI: 2. Use npm to install RippleAPI:
`npm install ripple-lib` `npm install ripple-lib`

8634
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,12 +20,12 @@
"bignumber.js": "^2.0.3", "bignumber.js": "^2.0.3",
"https-proxy-agent": "^1.0.0", "https-proxy-agent": "^1.0.0",
"jsonschema": "^1.1.1", "jsonschema": "^1.1.1",
"lodash": "^3.1.0", "lodash": "^4.17.4",
"ripple-address-codec": "^2.0.1", "ripple-address-codec": "^2.0.1",
"ripple-binary-codec": "^0.1.10", "ripple-binary-codec": "^0.1.10",
"ripple-hashes": "^0.3.0", "ripple-hashes": "^0.3.0",
"ripple-keypairs": "^0.10.0", "ripple-keypairs": "^0.10.0",
"ripple-lib-transactionparser": "^0.6.0", "ripple-lib-transactionparser": "^0.6.1",
"ws": "^1.0.1" "ws": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
@@ -39,7 +39,7 @@
"babel-preset-es2015": "^6.3.13", "babel-preset-es2015": "^6.3.13",
"babel-preset-stage-1": "^6.3.13", "babel-preset-stage-1": "^6.3.13",
"babel-register": "^6.3.13", "babel-register": "^6.3.13",
"coveralls": "^2.11.9", "coveralls": "^2.13.1",
"doctoc": "^0.15.0", "doctoc": "^0.15.0",
"ejs": "^2.3.4", "ejs": "^2.3.4",
"eslint": "^2.9.0", "eslint": "^2.9.0",

View File

@@ -29,7 +29,7 @@ unittest() {
npm run coveralls npm run coveralls
# test compiled version in "dist/npm" # test compiled version in "dist/npm"
babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/ $(npm bin)/babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/
echo "--reporter spec --timeout 5000 --slow 500" > test-compiled/mocha.opts echo "--reporter spec --timeout 5000 --slow 500" > test-compiled/mocha.opts
mkdir -p test-compiled/node_modules mkdir -p test-compiled/node_modules
ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api

View File

@@ -228,7 +228,7 @@ class Connection extends EventEmitter {
if (this._proxyURL !== undefined) { if (this._proxyURL !== undefined) {
const parsedURL = parseURL(this._url) const parsedURL = parseURL(this._url)
const parsedProxyURL = parseURL(this._proxyURL) const parsedProxyURL = parseURL(this._proxyURL)
const proxyOverrides = _.omit({ const proxyOverrides = _.omitBy({
secureEndpoint: (parsedURL.protocol === 'wss:'), secureEndpoint: (parsedURL.protocol === 'wss:'),
secureProxy: (parsedProxyURL.protocol === 'https:'), secureProxy: (parsedProxyURL.protocol === 'https:'),
auth: this._proxyAuthorization, auth: this._proxyAuthorization,
@@ -250,7 +250,7 @@ class Connection extends EventEmitter {
const base64 = new Buffer(this._authorization).toString('base64') const base64 = new Buffer(this._authorization).toString('base64')
options.headers = {Authorization: `Basic ${base64}`} options.headers = {Authorization: `Basic ${base64}`}
} }
const optionsOverrides = _.omit({ const optionsOverrides = _.omitBy({
ca: this._trustedCertificates, ca: this._trustedCertificates,
key: this._key, key: this._key,
passphrase: this._passphrase, passphrase: this._passphrase,

View File

@@ -53,7 +53,7 @@ function convertKeysFromSnakeCaseToCamelCase(obj: any): any {
} }
function removeUndefined(obj: Object): Object { function removeUndefined(obj: Object): Object {
return _.omit(obj, _.isUndefined) return _.omitBy(obj, _.isUndefined)
} }
/** /**

View File

@@ -67,7 +67,7 @@ function renameCounterpartyToIssuerInOrder(order: RequestBookOffersArgs) {
const taker_gets = renameCounterpartyToIssuer(order.taker_gets) const taker_gets = renameCounterpartyToIssuer(order.taker_gets)
const taker_pays = renameCounterpartyToIssuer(order.taker_pays) const taker_pays = renameCounterpartyToIssuer(order.taker_pays)
const changes = {taker_gets: taker_gets, taker_pays: taker_pays} const changes = {taker_gets: taker_gets, taker_pays: taker_pays}
return _.assign({}, order, _.omit(changes, _.isUndefined)) return _.assign({}, order, _.omitBy(changes, _.isUndefined))
} }
function signum(num) { function signum(num) {

View File

@@ -15,7 +15,7 @@ function formatPrepareResponse(txJSON: Object): Object {
} }
return { return {
txJSON: JSON.stringify(txJSON), txJSON: JSON.stringify(txJSON),
instructions: _.omit(instructions, _.isUndefined) instructions: _.omitBy(instructions, _.isUndefined)
} }
} }
@@ -73,7 +73,7 @@ function prepareTransaction(txJSON: Object, api: Object,
if (instructions.maxFee !== undefined) { if (instructions.maxFee !== undefined) {
const maxFeeDrops = common.xrpToDrops(instructions.maxFee) const maxFeeDrops = common.xrpToDrops(instructions.maxFee)
const normalFee = scaleValue(feeDrops, multiplier, extraFee) const normalFee = scaleValue(feeDrops, multiplier, extraFee)
txJSON.Fee = BigNumber.min(normalFee, maxFeeDrops).toString(); txJSON.Fee = BigNumber.min(normalFee, maxFeeDrops).toString()
} else { } else {
txJSON.Fee = scaleValue(feeDrops, multiplier, extraFee) txJSON.Fee = scaleValue(feeDrops, multiplier, extraFee)
} }