From bf1be2f843eae5d3a8245fb19efd9cb1994c79fa Mon Sep 17 00:00:00 2001 From: JST5000 Date: Tue, 18 Jul 2023 16:37:37 -0700 Subject: [PATCH] Make change non-breaking --- packages/xrpl/src/Wallet/index.ts | 4 +++- packages/xrpl/test/wallet/index.test.ts | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/xrpl/src/Wallet/index.ts b/packages/xrpl/src/Wallet/index.ts index 415b8f7b12..6b1d01e361 100644 --- a/packages/xrpl/src/Wallet/index.ts +++ b/packages/xrpl/src/Wallet/index.ts @@ -298,7 +298,9 @@ export class Wallet { opts: { masterAddress?: string; algorithm?: ECDSA } = {}, ): Wallet { const { publicKey, privateKey } = deriveKeypair(seed, { - algorithm: opts.algorithm ?? DEFAULT_ALGORITHM, + // TODO: replace this line with algorithm: opts.algorithm ?? DEFAULT_ALGORITHM + // To actually enforce the ed25519 default in the next breaking version. + algorithm: opts.algorithm, }) return new Wallet(publicKey, privateKey, { seed, diff --git a/packages/xrpl/test/wallet/index.test.ts b/packages/xrpl/test/wallet/index.test.ts index 8ba3005e46..eeff4b6229 100644 --- a/packages/xrpl/test/wallet/index.test.ts +++ b/packages/xrpl/test/wallet/index.test.ts @@ -110,8 +110,8 @@ describe('Wallet', function () { it('derives a wallet using default algorithm', function () { const wallet = Wallet.fromSeed(knownSecret) - assert.equal(wallet.publicKey, publicKeyED25519) - assert.equal(wallet.privateKey, privateKeyED25519) + assert.equal(wallet.publicKey, publicKeySecp256k1) + assert.equal(wallet.privateKey, privateKeySecp256k1) }) it('derives a wallet using algorithm ecdsa-secp256k1', function () { @@ -216,8 +216,8 @@ describe('Wallet', function () { it('derives a wallet using default algorithm', function () { const wallet = Wallet.fromSecret(knownSecret) - assert.equal(wallet.publicKey, publicKeyED25519) - assert.equal(wallet.privateKey, privateKeyED25519) + assert.equal(wallet.publicKey, publicKeySecp256k1) + assert.equal(wallet.privateKey, privateKeySecp256k1) }) it('derives a wallet using algorithm ecdsa-secp256k1', function () {