11import test , { only } from "ava"
2- import { ADDRESS , DATES } from "./constants" ;
2+ import { ADDRESS , TOKEN_ADDRESS , DATES } from "./constants" ;
33import { ERROR_MESSAGE_ADDRESS_NO_ADDRESS as NO_ADDRESS } from "../src/constants" ;
44import {
55 setUpPolly ,
@@ -64,7 +64,7 @@ test('Successfully gets address information', async t => {
6464 t . true ( info . hasProp ( 'balance' ) )
6565} )
6666test ( 'Successfully gets address information + pricing data' , async t => {
67- const info = await t . context . web3data . address . getInformation ( ADDRESS , { includePrice : true , currency : 'usd' } )
67+ const info = await t . context . web3data . address . getInformation ( TOKEN_ADDRESS , { includePrice : true , currency : 'usd' } )
6868 t . true ( info . hasProp ( 'balance' ) )
6969 t . true ( info . hasProp ( 'price' ) )
7070 t . true ( info . price . balance . hasProp ( 'currency' ) )
@@ -178,7 +178,7 @@ test('Successfully gets address transactions - no filters', async t => {
178178} )
179179
180180test ( 'Successfully gets address transactions - with filters' , async t => {
181- const [ transaction ] = await t . context . web3data . address . getTransactions ( ADDRESS , { includePrice : true } )
181+ const [ transaction ] = await t . context . web3data . address . getTransactions ( TOKEN_ADDRESS , { includePrice : true } )
182182 t . true ( transaction . hasProp ( 'price' ) )
183183} )
184184
@@ -195,7 +195,7 @@ test('Successfully gets address pending transactions - no filters', async t => {
195195} )
196196
197197test ( 'Successfully gets address pending transactions - with filters' , async t => {
198- const [ pendingTxn ] = await t . context . web3data . address . getPendingTransactions ( ADDRESS , { includePrice : true } )
198+ const [ pendingTxn ] = await t . context . web3data . address . getPendingTransactions ( TOKEN_ADDRESS , { includePrice : true } )
199199 t . true ( pendingTxn . hasProp ( 'price' ) )
200200} )
201201
@@ -218,7 +218,7 @@ test('Successfully gets address tokens - no filters', async t => {
218218} )
219219
220220test ( 'Successfully gets address tokens - with filters' , async t => {
221- const [ token ] = await t . context . web3data . address . getTokens ( ADDRESS , { includePrice : true } )
221+ const [ token ] = await t . context . web3data . address . getTokens ( TOKEN_ADDRESS , { includePrice : true } )
222222 t . false ( token . hasProp ( 'price' ) )
223223} )
224224
@@ -289,7 +289,7 @@ test('Successfully gets latest address balance (no filters)', async t => {
289289} )
290290
291291test ( 'Successfully gets latest address balance (with filters)' , async t => {
292- const balance = await t . context . web3data . address . getBalance ( ADDRESS , { includePrice : true , currency : 'btc' } )
292+ const balance = await t . context . web3data . address . getBalance ( TOKEN_ADDRESS , { includePrice : true , currency : 'btc' } )
293293 t . true ( balance . hasProp ( 'price' ) )
294294 /* Test that balance is numerical */
295295 t . is ( balance . price . balance . currency , 'btc' )
@@ -302,7 +302,7 @@ test('Successfully gets historical address balance (no filters)', async t => {
302302} )
303303
304304test ( 'Successfully gets historical address balance (with filters)' , async t => {
305- const histBalance = await t . context . web3data . address . getBalance ( ADDRESS , { startDate : DATES [ "2019-10-14" ] , endDate : DATES [ "2019-10-15" ] , includePrice : true } )
305+ const histBalance = await t . context . web3data . address . getBalance ( TOKEN_ADDRESS , { startDate : DATES [ "2019-10-14" ] , endDate : DATES [ "2019-10-15" ] , includePrice : true } )
306306 t . true ( histBalance . hasProp ( 'data' ) )
307307 t . true ( Array . isArray ( histBalance . data ) )
308308 t . true ( histBalance . metadata . columns . includes ( 'price' ) )
@@ -324,10 +324,10 @@ test('Successfully gets latest address balance + token balances for multiple add
324324} )
325325
326326test ( 'Successfully gets latest address balance + token balances + pricing data for multiple addresses ' , async t => {
327- const balances = await t . context . web3data . address . getBalance ( [ ADDRESS , '0xce9af648a831ddf0cd6d05e3fe5787b3c7987246' ] , { includeTokens : true , includePrice : true } )
328- t . true ( balances . hasProp ( ADDRESS ) )
329- t . true ( balances [ ADDRESS ] . hasProp ( 'price' ) )
330- t . true ( balances [ ADDRESS ] . hasProp ( 'tokens' ) )
327+ const balances = await t . context . web3data . address . getBalance ( [ TOKEN_ADDRESS , '0xce9af648a831ddf0cd6d05e3fe5787b3c7987246' ] , { includeTokens : true , includePrice : true } )
328+ t . true ( balances . hasProp ( TOKEN_ADDRESS ) )
329+ t . true ( balances [ TOKEN_ADDRESS ] . hasProp ( 'price' ) )
330+ t . true ( balances [ TOKEN_ADDRESS ] . hasProp ( 'tokens' ) )
331331
332332 /* Test that balance is numerical */
333333 t . regex ( balances [ ADDRESS ] . balance , / [ 0 - 9 ] / )
0 commit comments