You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(resp.rows.length===0)logger.error('Can not find suitable data in db')
33
+
expect(resp.rows.length).toBeGreaterThan(0)
34
+
returnresp
35
+
}
36
+
36
37
it('can return active stake snapshots for an address',async()=>{
37
38
constdbResp=awaitgetTestData('WITH current_epoch AS (SELECT max(epoch_no) AS epoch_no FROM block) select view from epoch_stake join stake_address on epoch_stake.addr_id = stake_address.id where epoch_no=(SELECT epoch_no FROM current_epoch) ORDER BY RANDOM() LIMIT 1;')
constdbEpoch=awaitdb.query('SELECT max(epoch_no) AS epoch_no FROM block;')
63
-
constdbSlotLeader=awaitdb.query('SELECT description FROM slot_leader WHERE slot_leader.description IS NOT NULL ORDER BY RANDOM() LIMIT 1;')
64
-
constdbCount=awaitdb.query('SELECT COUNT(*) as count FROM block join slot_leader sl on block.slot_leader_id = sl.id where description = '+'\''+dbSlotLeader.rows[0].description+'\' and epoch_no = '+dbEpoch.rows[0].epoch_no+';')
68
+
constdbEpoch=awaitgetTestData('SELECT max(epoch_no) AS epoch_no FROM block;')
69
+
constdbSlotLeader=awaitgetTestData('SELECT description FROM slot_leader WHERE slot_leader.description IS NOT NULL ORDER BY RANDOM() LIMIT 1;')
70
+
constdbCount=awaitgetTestData('SELECT COUNT(*) as count FROM block join slot_leader sl on block.slot_leader_id = sl.id where description = '+'\''+dbSlotLeader.rows[0].description+'\' and epoch_no = '+dbEpoch.rows[0].epoch_no+';')
65
71
logger.info('Epoch number -',dbEpoch.rows[0].epoch_no,', slot leader - ',dbSlotLeader.rows[0].description)
0 commit comments