Skip to content

Commit

Permalink
Make change non-breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
JST5000 committed Jul 18, 2023
1 parent 17b6622 commit bf1be2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/xrpl/src/Wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions packages/xrpl/test/wallet/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit bf1be2f

Please sign in to comment.