Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update default cryptographic algorithm in Wallet class methods #770

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change Wallet.from_secret_numbers default signing algorithm
  • Loading branch information
ckeshava committed Nov 8, 2024
commit 69b5a1d3919910e6bb1239e7c44ad8096622a6c0
4 changes: 2 additions & 2 deletions tests/unit/asyn/wallet/test_main.py
Original file line number Diff line number Diff line change
@@ -317,12 +317,12 @@ def test_from_entropy_using_regular_key_pair_using_algorithm_ed25519(self):
def test_from_secret_numbers_string_using_default_algorithm(self):
wallet = Wallet.from_secret_numbers(constants["secret_numbers"]["string"])

_test_wallet_values(self, wallet, "secret_numbers", "secp256k1")
_test_wallet_values(self, wallet, "secret_numbers", "ed25519")

def test_from_secret_numbers_array_using_default_algorithm(self):
wallet = Wallet.from_secret_numbers(constants["secret_numbers"]["array"])

_test_wallet_values(self, wallet, "secret_numbers", "secp256k1")
_test_wallet_values(self, wallet, "secret_numbers", "ed25519")

def test_from_secret_numbers_string_using_algorithm_ecdsa_secp256k1(self):
wallet = Wallet.from_secret_numbers(
7 changes: 3 additions & 4 deletions xrpl/wallet/main.py
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ def from_secret_numbers(
secret_numbers: List[str] | str,
*,
master_address: Optional[str] = None,
algorithm: CryptoAlgorithm = CryptoAlgorithm.SECP256K1,
algorithm: CryptoAlgorithm = CryptoAlgorithm.ED25519,
) -> Self:
"""
Generates a new Wallet from secret numbers.
@@ -216,9 +216,8 @@ def from_secret_numbers(
master_address: Include if a Wallet uses a Regular Key Pair. It must be
the master address of the account. The default is `None`.
algorithm: The digital signature algorithm to generate an address for.
The default is `SECP256K1
<https://xrpl.org/cryptographic-keys.html#secp256k1-key-derivation>`_
(XUMM standard as of December 2022).
The default is ED25519. Docs:
https://xrpl.org/docs/concepts/accounts/cryptographic-keys#ed25519-key-derivation

Returns:
The wallet that is generated from the given secret numbers.