Skip to content

Commit

Permalink
fix: cycle signer filter (#1916)
Browse files Browse the repository at this point in the history
* fix: cycle signer filter

* fix: test
  • Loading branch information
rafaelcr authored Mar 28, 2024
1 parent 3d870ed commit dc7d600
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/datastore/pg-store-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export class PgStoreV2 extends BasePgStoreModule {
SELECT
signing_key, weight, stacked_amount, weight_percent, stacked_amount_percent
FROM pox_sets
WHERE canonical = TRUE AND cycle_number = ${args.cycle_number}
WHERE canonical = TRUE AND cycle_number = ${args.cycle_number} AND signing_key = ${args.signer_key}
LIMIT 1
`;
if (results.count > 0) return results[0];
Expand Down
10 changes: 5 additions & 5 deletions src/tests/pox-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ describe('PoX tests', () => {
expect(signer.status).toBe(200);
expect(signer.type).toBe('application/json');
expect(JSON.parse(signer.text)).toStrictEqual({
signing_key: '0x029874497a7952483aa23890e9d0898696f33864d3df90939930a1f45421fe3b09',
stacked_amount: '457500900000000000',
stacked_amount_percent: 33.333333333333336,
weight: 3,
weight_percent: 33.33333333333333,
signing_key: '0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d',
stacked_amount: '686251350000000000',
stacked_amount_percent: 50,
weight: 5,
weight_percent: 55.55555555555556,
});
const stackers = await supertest(api.server).get(
`/extended/v2/pox/cycles/14/signers/0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d/stackers`
Expand Down

0 comments on commit dc7d600

Please sign in to comment.