Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LW-10576 Set not zero value for pool and stake key deposit in local-network #1287

Merged
merged 2 commits into from
May 30, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,10 @@ describe('StakePoolHttpService', () => {
expect(response.pageResults).toEqual(responseCached.pageResults);
expect(response.pageResults[0].status).toEqual(Cardano.StakePoolStatus.Activating);
});
it('pledgeMet false, status activating, and condition', async () => {

it('pledgeMet false, status active, and condition', async () => {
const activating = await fixtureBuilder.getPools(1, {
with: [PoolWith.ActivatingState, PoolWith.PledgeNotMet]
with: [PoolWith.ActiveState, PoolWith.PledgeNotMet]
});
const filter: QueryStakePoolsArgs = {
filters: {
Expand All @@ -975,13 +976,14 @@ describe('StakePoolHttpService', () => {
pagination
};

const options = addPledgeMetFilter(addStatusFilter(filter, Cardano.StakePoolStatus.Activating), false);
const options = addPledgeMetFilter(addStatusFilter(filter, Cardano.StakePoolStatus.Active), false);
const response = await provider.queryStakePools(options);
const responseCached = await provider.queryStakePools(options);
expect(response.pageResults.length).toBeGreaterThan(0);
expect(response.pageResults).toEqual(responseCached.pageResults);
expect(response.pageResults[0].status).toEqual(Cardano.StakePoolStatus.Activating);
expect(response.pageResults[0].status).toEqual(Cardano.StakePoolStatus.Active);
});

it('pledgeMet true, status retired, or condition', async () => {
const options = addPledgeMetFilter(
addStatusFilter(setFilterCondition(filterArgs, 'or'), Cardano.StakePoolStatus.Retired),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe('TypeormStakePoolProvider', () => {
let filterArgs: QueryStakePoolsArgs;
let poolsInfo: PoolInfo[];
let poolsInfoWithMeta: PoolInfo[];
let poolsInfoWithUniqueMeta: PoolInfo[];
let poolsInfoWithMetaFiltered: PoolInfo[];
let poolsInfoWithMetrics: PoolInfo[];
let poolsInfoWithMetricsFiltered: PoolInfo[];
Expand Down Expand Up @@ -108,15 +109,18 @@ describe('TypeormStakePoolProvider', () => {
poolsInfo = await fixtureBuilder.getPools(1000, ['active', 'activating', 'retired', 'retiring']);
poolsInfoWithMeta = poolsInfo.filter((pool) => isNotNil(pool.metadataUrl));
poolsInfoWithMetrics = poolsInfo.filter((pool) => isNotNil(pool.saturation));
poolsInfoWithUniqueMeta = poolsInfoWithMeta
.filter(({ name, ticker }) => name !== 'Same Name' && ticker !== 'SP6a7')
.sort((a, b) => (a.name < b.name ? -1 : 1));

filterArgs = {
filters: {
identifier: {
_condition: 'or',
values: [
{ ticker: poolsInfoWithMeta[0].ticker },
{ name: poolsInfoWithMeta[1].name },
{ id: poolsInfoWithMeta[2].id }
{ ticker: poolsInfoWithUniqueMeta[0].ticker },
{ name: poolsInfoWithUniqueMeta[1].name },
{ id: poolsInfoWithUniqueMeta[2].id }
]
}
},
Expand Down Expand Up @@ -625,7 +629,7 @@ describe('TypeormStakePoolProvider', () => {
describe('by default, result is sorted by relevance', () => {
it('with stringent search', async () => {
const response = await provider.queryStakePools({ filters: { text: 'sp11' }, pagination });
expect(response.pageResults.map(({ metadata }) => metadata?.ticker)).toEqual(['SP11', 'SP1', 'SP10']);
expect(response.pageResults.map(({ metadata }) => metadata?.ticker)).toEqual(['SP11', 'SP10', 'SP1']);
});

it('with mild search', async () => {
Expand Down Expand Up @@ -739,7 +743,7 @@ describe('TypeormStakePoolProvider', () => {
const response = await provider.queryStakePools(
setSortCondition(setFilterCondition(filterArgs, 'or'), 'asc', 'ticker')
);
const expected = [...poolsInfoWithMeta].sort((a, b) => (a.ticker < b.ticker ? -1 : 1));
const expected = [...poolsInfoWithMetricsFiltered].sort((a, b) => (a.ticker < b.ticker ? -1 : 1));
expect(response.pageResults[0].metadata?.ticker).toEqual(expected[0].ticker);
expect(response.pageResults[1].metadata?.ticker).toEqual(expected[1].ticker);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ yarn test:build:verify

yarn workspace @cardano-sdk/e2e local-network:down
yarn workspace @cardano-sdk/e2e local-network:up -d --build
yarn workspace @cardano-sdk/e2e wait-for-network

yarn workspace @cardano-sdk/e2e test:wallet
yarn workspace @cardano-sdk/e2e test:long-running simple-delegation-rewards.test.ts
Expand Down
Loading
Loading