'use strict'
-import { Account, Wallet, Rpc } from 'libnemo'
+import { Account, Rpc, Wallet } from 'libnemo'
import { assert, env, suite, test } from './GLOBALS.mjs'
import { NANO_TEST_VECTORS, TEST_PASSWORD } from './VECTORS.mjs'
await Promise.all([
suite('Refreshing account info', { skip: false }, async () => {
-
await test('fetch balance, frontier, and representative', async () => {
const wallet = await Wallet.load('BIP-44', TEST_PASSWORD, NANO_TEST_VECTORS.BIP39_SEED)
await wallet.unlock(TEST_PASSWORD)
const account = await wallet.account()
+ assert.equal(NANO_TEST_VECTORS.ADDRESS_0, account.address)
await account.refresh(rpc)
assert.exists(account.balance)
assert.exists(account.frontier)
assert.equal(typeof account.frontier, 'string')
assert.notEqual(account.frontier, '')
- assert.ok(/^[A-F0-9]{64}$/i.test(account.frontier ?? ''))
+ assert.ok(/^[0-9A-F]{64}$/i.test(account.frontier ?? ''))
assert.exists(account.representative)
assert.notEqual(account.representative, '')