Skip to content

Commit e15c3d1

Browse files
committed
chore: see second last value for auction params
1 parent 19f661a commit e15c3d1

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

test/e2e/specs/liquidation-reconstitution.spec.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import {
88
webWalletURL,
99
webWalletSelectors,
1010
tokens,
11-
extractNumber,
1211
} from '../test.utils';
1312

1413
describe('Liquidation Reconstitution Testing', () => {
1514
let startTime;
1615
const AGORIC_NET = Cypress.env('AGORIC_NET').trim();
1716
const network =
1817
{ local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet';
19-
18+
const checkLastestAuctionValue =
19+
network === 'local' || network === 'emerynet' ? false : true;
2020
const currentConfig = configMap[network];
2121
const QUICK_WAIT =
2222
AGORIC_NET === 'local' ? QUICK_WAIT_LOCAL : QUICK_WAIT_TESTNET;
@@ -545,7 +545,6 @@ describe('Liquidation Reconstitution Testing', () => {
545545
cy.fetchVStorageData({
546546
url: reserveURL,
547547
field: 'shortfallBalance',
548-
latest: true,
549548
}).then(output => {
550549
shortfallBalance = Number(
551550
(Number(output.value.slice(1)) / 1_000_000).toFixed(2),
@@ -621,9 +620,11 @@ describe('Liquidation Reconstitution Testing', () => {
621620

622621
const expectedValue = 9.99;
623622
cy.task('info', `Expected Value: ${expectedValue}`);
623+
// TODO: temporarily check second last value
624624
cy.fetchVStorageData({
625625
url: auctionURL,
626626
field: 'startPrice',
627+
latest: checkLastestAuctionValue,
627628
}).then(data => {
628629
cy.calculateRatios(data, { hasDenom: true, useValue: false }).then(
629630
result => {
@@ -637,9 +638,11 @@ describe('Liquidation Reconstitution Testing', () => {
637638
it('should verify the value of startProceedsGoal', () => {
638639
const expectedValue = 309.54;
639640
cy.task('info', `Expected Value: ${expectedValue}`);
641+
// TODO: temporarily check second last value
640642
cy.fetchVStorageData({
641643
url: auctionURL,
642644
field: 'startProceedsGoal',
645+
latest: checkLastestAuctionValue,
643646
}).then(data => {
644647
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
645648
result => {
@@ -653,9 +656,11 @@ describe('Liquidation Reconstitution Testing', () => {
653656
it('should verify the value of startCollateral', () => {
654657
const expectedValue = 45;
655658
cy.task('info', `Expected Value: ${expectedValue}`);
659+
// TODO: temporarily check second last value
656660
cy.fetchVStorageData({
657661
url: auctionURL,
658662
field: 'startCollateral',
663+
latest: checkLastestAuctionValue,
659664
}).then(data => {
660665
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
661666
result => {
@@ -697,9 +702,11 @@ describe('Liquidation Reconstitution Testing', () => {
697702

698703
const expectedValue = 31.414987;
699704
cy.task('info', `Expected Value: ${expectedValue}`);
705+
// TODO: temporarily check second last value
700706
cy.fetchVStorageData({
701707
url: auctionURL,
702708
field: 'collateralAvailable',
709+
latest: checkLastestAuctionValue,
703710
}).then(data => {
704711
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
705712
result => {
@@ -720,7 +727,6 @@ describe('Liquidation Reconstitution Testing', () => {
720727
cy.fetchVStorageData({
721728
url: reserveURL,
722729
field: 'shortfallBalance',
723-
latest: true,
724730
})
725731
.then(newBalanceObj => {
726732
let newBalance = Number(

test/e2e/specs/liquidation.spec.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import {
99
QUICK_WAIT_TESTNET,
1010
THIRTY_SECONDS,
1111
tokens,
12-
extractNumber,
1312
} from '../test.utils';
1413

1514
describe('Liquidation Testing', () => {
1615
let startTime;
1716
const AGORIC_NET = Cypress.env('AGORIC_NET').trim();
1817
const network =
1918
{ local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet';
19+
const checkLastestAuctionValue =
20+
network === 'local' || network === 'emerynet' ? false : true;
2021

2122
const currentConfig = configMap[network];
2223
const QUICK_WAIT =
@@ -540,7 +541,6 @@ describe('Liquidation Testing', () => {
540541
cy.fetchVStorageData({
541542
url: reserveURL,
542543
field: 'shortfallBalance',
543-
latest: true,
544544
}).then(output => {
545545
shortfallBalance = Number(
546546
(Number(output.value.slice(1)) / 1_000_000).toFixed(2),
@@ -629,9 +629,11 @@ describe('Liquidation Testing', () => {
629629

630630
const expectedValue = 9.99;
631631
cy.task('info', `Expected Value: ${expectedValue}`);
632+
// TODO: temporarily check second last value
632633
cy.fetchVStorageData({
633634
url: auctionURL,
634635
field: 'startPrice',
636+
latest: checkLastestAuctionValue,
635637
}).then(data => {
636638
cy.calculateRatios(data, { hasDenom: true, useValue: false }).then(
637639
result => {
@@ -645,9 +647,11 @@ describe('Liquidation Testing', () => {
645647
it('should verify the value of startProceedsGoal', () => {
646648
const expectedValue = 309.54;
647649
cy.task('info', `Expected Value: ${expectedValue}`);
650+
// TODO: temporarily check second last value
648651
cy.fetchVStorageData({
649652
url: auctionURL,
650653
field: 'startProceedsGoal',
654+
latest: checkLastestAuctionValue,
651655
}).then(data => {
652656
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
653657
result => {
@@ -661,9 +665,11 @@ describe('Liquidation Testing', () => {
661665
it('should verify the value of startCollateral', () => {
662666
const expectedValue = 45;
663667
cy.task('info', `Expected Value: ${expectedValue}`);
668+
// TODO: temporarily check second last value
664669
cy.fetchVStorageData({
665670
url: auctionURL,
666671
field: 'startCollateral',
672+
latest: checkLastestAuctionValue,
667673
}).then(data => {
668674
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
669675
result => {
@@ -706,9 +712,11 @@ describe('Liquidation Testing', () => {
706712

707713
const expectedValue = 9.659301;
708714
cy.task('info', `Expected Value: ${expectedValue}`);
715+
// TODO: temporarily check second last value
709716
cy.fetchVStorageData({
710717
url: auctionURL,
711718
field: 'collateralAvailable',
719+
latest: checkLastestAuctionValue,
712720
}).then(data => {
713721
cy.calculateRatios(data, { hasDenom: false, useValue: true }).then(
714722
result => {
@@ -806,7 +814,6 @@ describe('Liquidation Testing', () => {
806814
cy.fetchVStorageData({
807815
url: reserveURL,
808816
field: 'shortfallBalance',
809-
latest: true,
810817
})
811818
.then(newBalanceObj => {
812819
let newBalance = Number(

test/e2e/support.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Cypress.Commands.add('provisionFromFaucet', (walletAddress, command) => {
269269
});
270270

271271
Cypress.Commands.add('fetchVStorageData', params => {
272-
const { url, field, latest = false } = params;
272+
const { url, field, latest = true } = params;
273273
cy.request(url).then(response => {
274274
expect(response.status).to.eq(200);
275275
cy.task('info', `Data fetched successfully for ${field}`);

0 commit comments

Comments
 (0)