Add NFT Devnet as an inferable faucet (#2024)

* Add NFT Devnet to implicit fundWallet
This commit is contained in:
Jackson Mills
2022-06-15 11:12:37 -07:00
committed by GitHub
parent 4fddd8f41d
commit 7732f22858
3 changed files with 36 additions and 0 deletions

View File

@@ -69,6 +69,35 @@ describe('fundWallet', function () {
await api.disconnect()
})
it('can generate and fund wallets on nft-devnet', async function () {
const api = new Client('ws://xls20-sandbox.rippletest.net:51233')
await api.connect()
const { wallet, balance } = await api.fundWallet()
assert.notEqual(wallet, undefined)
assert(isValidClassicAddress(wallet.classicAddress))
assert(isValidXAddress(wallet.getXAddress()))
const info = await api.request({
command: 'account_info',
account: wallet.classicAddress,
})
assert.equal(dropsToXrp(info.result.account_data.Balance), balance)
const { balance: newBalance } = await api.fundWallet(wallet, {
faucetHost: 'faucet-nft.ripple.com',
})
const afterSent = await api.request({
command: 'account_info',
account: wallet.classicAddress,
})
assert.equal(dropsToXrp(afterSent.result.account_data.Balance), newBalance)
await api.disconnect()
})
it('can generate and fund wallets using a custom host', async function () {
const api = new Client('ws://xls20-sandbox.rippletest.net:51233')