fromWIF.spec.js 678 B

12345678910111213141516171819202122
  1. /* Import modules. */
  2. const Nito = require('../..')
  3. describe('Purse:fromWIF', () => {
  4. test('it should initialize a node from its WIF', async () => {
  5. /* Initialize WIF. */
  6. const wif = 'KxzMaq6eFVJFPaEM7UH7yG8nCFNmNBPHZYPakNAVBcEm7eGrDnSc'
  7. /* Instantiate new purse. */
  8. // NOTE: Disable live updates.
  9. const purse = new Nito.Purse(wif, false)
  10. /* Set cash address. */
  11. const cashAddress = purse._node.toAddress().toString()
  12. /* Set expected. */
  13. const expected = 'bitcoincash:qrk3ykhr7ssrl6nc50xfcgur703h5cjkguxkk0tjxc'
  14. /* Evaluate test. */
  15. expect(cashAddress).toEqual(expected)
  16. })
  17. })