Skip to content

Commit

Permalink
Re-add breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
JST5000 committed Jul 19, 2023
1 parent d7bb541 commit 158183e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions packages/xrpl/src/Wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ export class Wallet {
opts: { masterAddress?: string; algorithm?: ECDSA } = {},
): Wallet {
const { publicKey, privateKey } = deriveKeypair(seed, {
// TODO: replace this line with algorithm: opts.algorithm ?? DEFAULT_ALGORITHM
// To actually enforce the ed25519 default in the next breaking version.
algorithm: opts.algorithm,
algorithm: opts.algorithm ?? DEFAULT_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 @@ -118,8 +118,8 @@ describe('Wallet', function () {
const algorithm = ECDSA.secp256k1
const wallet = Wallet.fromSeed(knownSecret, { algorithm })

assert.equal(wallet.publicKey, publicKeySecp256k1)
assert.equal(wallet.privateKey, privateKeySecp256k1)
assert.equal(wallet.publicKey, publicKeyED25519)
assert.equal(wallet.privateKey, privateKeyED25519)
})

it('derives a wallet using algorithm ed25519', 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, publicKeySecp256k1)
assert.equal(wallet.privateKey, privateKeySecp256k1)
assert.equal(wallet.publicKey, publicKeyED25519)
assert.equal(wallet.privateKey, privateKeyED25519)
})

it('derives a wallet using algorithm ecdsa-secp256k1', function () {
Expand Down

0 comments on commit 158183e

Please sign in to comment.