XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.2k stars 511 forks source link

Export `ledgerAccept` from the integration test `utils.ts` #2423

Open JST5000 opened 1 year ago

JST5000 commented 1 year ago

When writing tests against a standalone ledger, it's very useful to be able to send a transaction, then progress the ledger and verify that the transaction was successful. This can be used to speed up CI testing like we do in xrpl.js since you can close ledgers immediately instead of waiting 3-5 seconds for a public network to validate the transactions.

So it'd be useful to export ledgerAccept from xrpl.js instead of just having it in the integration test utils.ts file.

mvadari commented 1 year ago

IMO it's not a good idea to export admin commands directly (without them being in some special admin section of the library) - people will get confused.

You can pass in any command to the client, including admin commands like ledger_accept, as long as you tell Typescript to ignore the type. I have a lot of xrpl.js scripts that do this.