Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@
"**/@agoric/xsnap": "0.14.3-u14.0",
"**/@agoric/time": "0.3.3-u14.0",
"**/@agoric/vats": "0.15.2-u15.0"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
84 changes: 15 additions & 69 deletions test/e2e/specs/liquidation-reconstitution.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import {

describe('Liquidation Reconstitution Testing', () => {
let startTime;
const AGORIC_NET = Cypress.env('AGORIC_NET').trim();
const network =
{ local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet';
const AGORIC_NET = 'emerynet';
const network = 'emerynet';
const checkLastestAuctionValue =
network === 'local' || network === 'emerynet' ? false : true;
const currentConfig = configMap[network];
Expand All @@ -35,9 +34,8 @@ describe('Liquidation Reconstitution Testing', () => {
const auctionURL = currentConfig.auctionURL;
const reserveURL = currentConfig.reserveURL;
let user1Mnemonic =
AGORIC_NET === networks.LOCAL ? currentConfig.user1Mnemonic : null;
let user1Address =
AGORIC_NET === networks.LOCAL ? currentConfig.user1Address : null;
'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology';
let user1Address = 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md';
let bidderAtomBalance = 0;
let bidderIstBalance = 0;
let shortfallBalance = 0;
Expand All @@ -46,79 +44,27 @@ describe('Liquidation Reconstitution Testing', () => {
it('add key for user1 wallet using agd', () => {
cy.task('info', `AGORIC_NET: ${AGORIC_NET}`);

if (AGORIC_NET === networks.LOCAL) {
cy.addKeys({
keyName: 'user1',
mnemonic: user1Mnemonic,
expectedAddress: user1Address,
});
} else {
cy.task('info', 'get mnemonic for the new wallet using agd');
cy.createNewUser({ keyName: 'user1' })
.then(output => {
cy.task('info', `${JSON.stringify(output)}`);
cy.wrap(output);
})
.then(({ mnemonic, address }) => {
user1Mnemonic = mnemonic;
cy.task('info', `user1 mnemonic: ${user1Mnemonic}`);
user1Address = address;
cy.task('info', `user1 address: ${address}`);
})
.then(() => {
expect(user1Mnemonic).to.not.be.null;
expect(user1Address).to.not.be.null;
});
}
cy.addKeys({
keyName: 'user1',
mnemonic: user1Mnemonic,
expectedAddress: user1Address,
});
});

it(
'should provision the user1 wallet',
{
retries: {
runMode: 2,
openMode: 2,
},
},
() => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
// UNTIL https://github.com/Agoric/instagoric/issues/64
for (let i = 0; i < 3; i++) {
cy.provisionFromFaucet(user1Address, 'delegate');
}
cy.provisionFromFaucet(user1Address, 'client');
},
);
});

context('Add key for bidder wallet', () => {
it('add key for bidder wallet using agd', () => {
if (AGORIC_NET === networks.LOCAL) {
cy.task('info', 'gov1 is the bidder wallet');
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
} else {
cy.addKeys({
keyName: 'bidder',
mnemonic: bidderMnemonic,
expectedAddress: bidderAddress,
});
}
cy.task('info', 'gov1 is the bidder wallet');
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
});
});

context('Add keys for gov1 and gov2 wallet', () => {
it('add keys for gov1 and gov2 wallet using agd', () => {
if (AGORIC_NET !== networks.LOCAL) {
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
}
cy.addKeys({
keyName: 'gov2',
mnemonic: gov2Mnemonic,
Expand Down
85 changes: 16 additions & 69 deletions test/e2e/specs/liquidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {

describe('Liquidation Testing', () => {
let startTime;
const AGORIC_NET = Cypress.env('AGORIC_NET').trim();
const network =
{ local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet';
const AGORIC_NET = 'emerynet';
const network = AGORIC_NET;

const checkLastestAuctionValue =
network === 'local' || network === 'emerynet' ? false : true;

Expand All @@ -37,9 +37,8 @@ describe('Liquidation Testing', () => {
const auctionURL = currentConfig.auctionURL;
const reserveURL = currentConfig.reserveURL;
let user1Mnemonic =
AGORIC_NET === networks.LOCAL ? currentConfig.user1Mnemonic : null;
let user1Address =
AGORIC_NET === networks.LOCAL ? currentConfig.user1Address : null;
'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology';
let user1Address = 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md';
let bidderAtomBalance = 0;
let user1AtomBalance = 0;
let bidderIstBalance = 0;
Expand All @@ -49,79 +48,27 @@ describe('Liquidation Testing', () => {
it('add key for user1 wallet using agd', () => {
cy.task('info', `AGORIC_NET: ${AGORIC_NET}`);

if (AGORIC_NET === networks.LOCAL) {
cy.addKeys({
keyName: 'user1',
mnemonic: user1Mnemonic,
expectedAddress: user1Address,
});
} else {
cy.task('info', 'get mnemonic for the new wallet using agd');
cy.createNewUser({ keyName: 'user1' })
.then(output => {
cy.task('info', `${JSON.stringify(output)}`);
cy.wrap(output);
})
.then(({ mnemonic, address }) => {
user1Mnemonic = mnemonic;
cy.task('info', `user1 mnemonic: ${user1Mnemonic}`);
user1Address = address;
cy.task('info', `user1 address: ${address}`);
})
.then(() => {
expect(user1Mnemonic).to.not.be.null;
expect(user1Address).to.not.be.null;
});
}
cy.addKeys({
keyName: 'user1',
mnemonic: user1Mnemonic,
expectedAddress: user1Address,
});
});

it(
'should provision the user1 wallet',
{
retries: {
runMode: 2,
openMode: 2,
},
},
() => {
cy.skipWhen(AGORIC_NET === networks.LOCAL);
// UNTIL https://github.com/Agoric/instagoric/issues/64
for (let i = 0; i < 3; i++) {
cy.provisionFromFaucet(user1Address, 'delegate');
}
cy.provisionFromFaucet(user1Address, 'client');
},
);
});

context('Add key for bidder wallet', () => {
it('add key for bidder wallet using agd', () => {
if (AGORIC_NET === networks.LOCAL) {
cy.task('info', 'gov1 is the bidder wallet');
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
} else {
cy.addKeys({
keyName: 'bidder',
mnemonic: bidderMnemonic,
expectedAddress: bidderAddress,
});
}
cy.task('info', 'gov1 is the bidder wallet');
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
});
});

context('Add keys for gov1 and gov2 wallet', () => {
it('add keys for gov1 and gov2 wallet using agd', () => {
if (AGORIC_NET !== networks.LOCAL) {
cy.addKeys({
keyName: 'gov1',
mnemonic: gov1Mnemonic,
expectedAddress: gov1Address,
});
}
cy.addKeys({
keyName: 'gov2',
mnemonic: gov2Mnemonic,
Expand Down
21 changes: 1 addition & 20 deletions test/e2e/specs/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,11 @@ describe('Vaults UI Test Cases', () => {
cy.setupWallet({
secretWords: customWalletPhrase,
});
} else if (AGORIC_NET === 'local') {
} else {
cy.setupWallet({
secretWords: mnemonics.user1,
walletName: 'user1',
});
} else if (AGORIC_NET === 'xnet') {
cy.task('info', 'Connecting with wallet...');
cy.setupWallet({
secretWords: Cypress.env('USER1_MNEMONIC'),
walletName: 'user1',
});
} else {
cy.setupWallet({
createNewWallet: true,
walletName: 'my created wallet',
selectedChains: ['Agoric'],
});

cy.getWalletAddress('Agoric').then(address => {
// provision BLD
cy.provisionFromFaucet(address, 'delegate');
// provision IST
cy.provisionFromFaucet(address, 'client');
});
}
});

Expand Down
10 changes: 5 additions & 5 deletions test/e2e/test.utils.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export const mnemonics = {
user1:
'tackle hen gap lady bike explain erode midnight marriage wide upset culture model select dial trial swim wood step scan intact what card symptom',
'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology',
gov1: 'such field health riot cost kitten silly tube flash wrap festival portion imitate this make question host bitter puppy wait area glide soldier knee',
gov2: 'physical immune cargo feel crawl style fox require inhale law local glory cheese bring swear royal spy buyer diesel field when task spin alley',
validator:
'soap hub stick bomb dish index wing shield cruel board siren force glory assault rotate busy area topple resource okay clown wedding hint unhappy',
};

export const accountAddresses = {
user1: 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq',
user1: 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md',
gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q',
gov2: 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277',
validator: 'agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl',
Expand Down Expand Up @@ -46,9 +46,9 @@ export const configMap = {
LIQUIDATING_TIMEOUT: 13 * 60 * 1000,
LIQUIDATED_TIMEOUT: 5 * 60 * 1000,
COMMAND_TIMEOUT: 6 * 60 * 1000,
bidderMnemonic: mnemonics.validator,
bidderAddress: accountAddresses.validator,
bidderWalletName: 'bidder',
bidderMnemonic: mnemonics.gov1,
bidderAddress: accountAddresses.gov1,
bidderWalletName: 'gov1',
gov1Mnemonic: mnemonics.gov1,
gov1Address: accountAddresses.gov1,
gov1WalletName: 'gov1',
Expand Down
Loading