await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
const node = new Node(process.env.NODE_URL, process.env.API_KEY_NAME, process.env.API_KEY_VALUE)
-const skip = true
+const skip = false
describe('refreshing account info', { skip }, async () => {
it('should fetch balance, frontier, and representative', async () => {
const account = accounts[0]
await account.refresh(node)
- assert.equal(typeof account.balance, 'string')
+ assert.equal(typeof account.balance, 'bigint')
assert.notEqual(account.balance, undefined)
assert.notEqual(account.balance, null)
assert.notEqual(account.balance, '')
- assert.equal(isNaN(parseInt(account.balance)), false)
- assert.equal(parseInt(account.balance) < 0, false)
+ assert.notEqual(account.balance < 0, true)
assert.equal(typeof account.frontier, 'string')
assert.notEqual(account.frontier, undefined)
describe('refreshing wallet accounts', { skip }, async () => {
it('should get balance, frontier, and representative for one account', async () => {
const accounts = await wallet.refresh(node)
- assert.ok(accounts[0] instanceof Account)
- assert.equal(typeof accounts[0].balance, 'bigint')
- assert.notEqual(accounts[0].frontier, undefined)
- assert.notEqual(accounts[0].frontier, null)
- assert.equal(typeof accounts[0].frontier, 'string')
+ const account = accounts[0]
+ assert.ok(account instanceof Account)
+ assert.equal(typeof account.balance, 'bigint')
+ assert.notEqual(account.frontier, undefined)
+ assert.notEqual(account.frontier, null)
+ assert.equal(typeof account.frontier, 'string')
})
it('should get balance, frontier, and representative for multiple accounts', async () => {