fix: tx fields for accounts allowing empty string (#2525)

Fields that were encoded as STAccounts were turning '' into rrrrrrrrrrrrrrrrrrrrrhoLvTp the ACCOUNT_ZERO account. They will now throw a ValidationError.

Invalid addresses on a transaction now throws a ValidationError when submitting a transaction instead of Error('checksum_invalid').

This change updates some error messages for fields a few fields that aren't accounts, DestinationTag or NFTokenID. They will still be of type ValidationError.

Fixes: #2517 and #2475

---------

Co-authored-by: Elliot Lee <github.public@intelliot.com>
This commit is contained in:
Caleb Kniffen
2023-10-18 10:25:57 -05:00
committed by GitHub
parent 8e929c5a57
commit 65bf5d40ea
28 changed files with 244 additions and 190 deletions

View File

@@ -9,10 +9,14 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
* Add pseudo transaction types to `tx` and `ledger` method responses.
* Add missing `type` param to `ledger_data` and `ledger` requests
* Type assertions around `PreviousTxnID` and `PreviousTxnLgrSeq` missing on some ledger objects
* Transaction fields that represent an address no longer allow an empty string (`''`). If you want to specify [ACCOUNT_ZERO](https://xrpl.org/addresses.html#special-addresses), you can specify `rrrrrrrrrrrrrrrrrrrrrhoLvTp`. ⚠️ **WARNING:** `rrrrrrrrrrrrrrrrrrrrrhoLvTp` is a black hole address, with no corresponding private key. Accounts/funds controlled by this address are not accessible.
* Invalid addresses on a transaction now throws a `ValidationError` when submitting a transaction instead of `Error('checksum_invalid')`
### Updated
* Make `LedgerEntryResponse` a generic so it can be used like `LedgerEntryResponse<Escrow>`
* Clean up typing of `type` param and the response property `account_objects` of the `account_objects` request.
* Error messages for fields that equate to an address, `DestinationTag`, or `NFTokenID`. They will still be of type `ValidationError`.
* Add alias type of `Account` to improve intellisense for Transaction fields that equate to an address.
### Changed
* Removed sidechain-devnet faucet support as it is being moved to Devnet