Closed ckeshava closed 6 months ago
i don't understand why the seed
is an Optional[str]
in Wallet
's constructor here: https://github.com/XRPLF/xrpl-py/blob/a38f61d3c88b4a9a0807392ef4b0cb30aa688ce5/xrpl/wallet/main.py#L45
In what kind of situations can we get away with a non-existent seed? I saw a unit test that does not specify a seed
for the Wallet
, but I couldn't find any other examples. https://github.com/XRPLF/xrpl-py/blob/a38f61d3c88b4a9a0807392ef4b0cb30aa688ce5/tests/unit/asyn/wallet/test_main.py#L81
i don't understand why the
seed
is anOptional[str]
inWallet
's constructor here:
You can generate a wallet if you know the public / private key.
Also I would mark this as a change for end users and update HISTORY.md (changing error messages counts because they may have error handling for a specific error type - not changing HISTORY.md is almost exclusively for docs / testing changes or functionally equivalent refactors).
I see. So a seed is used to generate a public/private pair of keys. But I can bypass that step if I already know the cryptographic key pair.
@justinr1234 can you please review this PR at your convenience?
High Level Overview of Change
Fixes https://github.com/XRPLF/xrpl-py/issues/503
It's ideal to validate a seed before creating a
Wallet
object. This is helpful in generating readable error messages for the users.Context of Change
Type of Change
Did you update CHANGELOG.md?
Wallet
will throw a different error. The current code throws aValueError
, this is hard to understand for users.Test Plan
I have added a unit test that validates the Exception thrown upon empty seed inputs into the
Wallet
class constructor.