Add request(), hasNextPage(), and requestNextPage() (#887)

* Add support for all rippled APIs, including subscriptions.
* Add support for arbitrary stream message types.
* Note that rippled APIs take amounts in drops.
* request() will be available in ripple-lib version 1.0.0+
This commit is contained in:
Elliot Lee
2018-05-10 15:43:56 -07:00
committed by GitHub
parent 823d93b86c
commit b2b6715ac0
23 changed files with 588 additions and 75 deletions

View File

@@ -394,10 +394,10 @@ describe('Connection', function() {
});
it('unrecognized message type', function(done) {
this.api.on('error', (errorCode, errorMessage, message) => {
assert.strictEqual(errorCode, 'badMessage');
assert.strictEqual(errorMessage, 'unrecognized message type: unknown');
assert.strictEqual(message, '{"type":"unknown"}');
// This enables us to automatically support any
// new messages added by rippled in the future.
this.api.connection.on('unknown', (event) => {
assert.deepEqual(event, {type: 'unknown'})
done();
});