Closed dangell7 closed 1 year ago
For an example we will use the TrustSet Tx.
We already validate below in cs, but in the js function there is a few extra validation methods. The basic process is validate Required/Optional then validate type, then theres some clever validation on some transactions.
I think we should refactor them into one function on the truncation just like they did in JS. So if you can copy what was done in the TxFormat that might speed it up for a few validation checks.
The transactions in the js/py library include a validation function.
See here for example
We need to add this validation to every transaction.
JS
Transaction Validation Main Function:
https://github.com/XRPLF/xrpl.js/blob/984a58e642a4cde09aee320efe195d4e651b7733/packages/xrpl/src/models/transactions/transaction.ts#L99
TrustSet Validation Function:
https://github.com/XRPLF/xrpl.js/blob/main/packages/xrpl/src/models/transactions/trustSet.ts#L127