From 3ff4929a49aed62f7a4fc9f39fee53f7fad8fcc2 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Tue, 4 Sep 2018 18:31:24 -0700 Subject: [PATCH] Fix PendingLedgerVersionError message and export FormattedTransactionType (#941) --- src/common/errors.ts | 2 +- src/index.ts | 7 +++++-- test/api-test.js | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/common/errors.ts b/src/common/errors.ts index 7cf8a1df..4e4ccd3d 100644 --- a/src/common/errors.ts +++ b/src/common/errors.ts @@ -70,7 +70,7 @@ class MissingLedgerHistoryError extends RippleError { class PendingLedgerVersionError extends RippleError { constructor(message?: string) { - super(message || 'maxLedgerVersion is greater than server\'s most recent ' + + super(message || 'maxLedgerVersion is greater than server\'s most recent' + ' validated ledger') } } diff --git a/src/index.ts b/src/index.ts index 7b1e6e86..f9409a53 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,8 @@ - - export {RippleAPI} from './api' + +export { + FormattedTransactionType +} from './transaction/types' + // Broadcast api is experimental export {RippleAPIBroadcast} from './broadcast' diff --git a/test/api-test.js b/test/api-test.js index b69dbe8f..2750315c 100644 --- a/test/api-test.js +++ b/test/api-test.js @@ -1629,6 +1629,8 @@ describe('RippleAPI', function () { assert(false, 'Should throw PendingLedgerVersionError'); }).catch(error => { assert(error instanceof this.api.errors.PendingLedgerVersionError); + assert.strictEqual(error.message, 'maxLedgerVersion is greater than server\'s' + + ' most recent validated ledger') }); });