From 1037e0da886080ea71d4490f02d68565fd5f7a0e Mon Sep 17 00:00:00 2001 From: Jackson Mills Date: Mon, 13 Sep 2021 13:44:21 -0700 Subject: [PATCH] Remove deprecated deriveAddress from Client (#1614) * Removing deriveAddress and X from client * Remove deriveAddress from derive.ts * Remove linting exception for function lines --- src/client/index.ts | 6 ------ src/utils/derive.ts | 2 +- src/utils/index.ts | 3 +-- test/{client => utils}/deriveXAddress.ts | 6 +++--- 4 files changed, 5 insertions(+), 12 deletions(-) rename test/{client => utils}/deriveXAddress.ts (86%) diff --git a/src/client/index.ts b/src/client/index.ts index 6405bef9..410bb9b0 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -109,7 +109,6 @@ import { import { BaseRequest, BaseResponse } from '../models/methods/baseMethod' import combine from '../transaction/combine' import { sign } from '../transaction/sign' -import { deriveAddress, deriveXAddress } from '../utils/derive' import generateFaucetWallet from '../wallet/generateFaucetWallet' import { @@ -556,11 +555,6 @@ class Client extends EventEmitter { public errors = errors - public static deriveXAddress = deriveXAddress - - // Client.deriveClassicAddress (static) is a new name for client.deriveAddress - public static deriveClassicAddress = deriveAddress - public static formatBidsAndAsks = formatBidsAndAsks /** diff --git a/src/utils/derive.ts b/src/utils/derive.ts index dc8f41c8..60a7a5a9 100644 --- a/src/utils/derive.ts +++ b/src/utils/derive.ts @@ -18,4 +18,4 @@ function deriveXAddress(options: DeriveOptions): string { return classicAddressToXAddress(classicAddress, options.tag, options.test) } -export { deriveKeypair, deriveAddress, deriveXAddress } +export { deriveKeypair, deriveXAddress } diff --git a/src/utils/index.ts b/src/utils/index.ts index 56c55219..4f11c501 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -3,7 +3,7 @@ import { xAddressToClassicAddress } from 'ripple-address-codec' import { ValidationError } from '../common/errors' import { RippledAmount } from '../common/types/objects' -import { deriveKeypair, deriveAddress, deriveXAddress } from './derive' +import { deriveKeypair, deriveXAddress } from './derive' import { generateXAddress } from './generateAddress' import { computeSignedTransactionHash, @@ -125,7 +125,6 @@ export { computePaymentChannelHash, generateXAddress, deriveKeypair, - deriveAddress, deriveXAddress, signPaymentChannelClaim, verifyPaymentChannelClaim, diff --git a/test/client/deriveXAddress.ts b/test/utils/deriveXAddress.ts similarity index 86% rename from test/client/deriveXAddress.ts rename to test/utils/deriveXAddress.ts index b04fc19c..d982160b 100644 --- a/test/client/deriveXAddress.ts +++ b/test/utils/deriveXAddress.ts @@ -1,11 +1,11 @@ import { assert } from 'chai' -import { Client } from '../../src' +import { deriveXAddress } from 'xrpl-local' describe('client.deriveXAddress', function () { it('returns address for public key', function () { assert.equal( - Client.deriveXAddress({ + deriveXAddress({ publicKey: '035332FBA71D705BD5D97014A833BE2BBB25BEFCD3506198E14AFEA241B98C2D06', tag: false, @@ -14,7 +14,7 @@ describe('client.deriveXAddress', function () { 'XVZVpQj8YSVpNyiwXYSqvQoQqgBttTxAZwMcuJd4xteQHyt', ) assert.equal( - Client.deriveXAddress({ + deriveXAddress({ publicKey: '035332FBA71D705BD5D97014A833BE2BBB25BEFCD3506198E14AFEA241B98C2D06', tag: false,