Skip to content

Commit deb2cd7

Browse files
authored
refactor(core-api): remove search endpoints (#4067)
1 parent 6ff4072 commit deb2cd7

File tree

21 files changed

+160
-1022
lines changed

21 files changed

+160
-1022
lines changed

__tests__/integration/core-api/controllers/delegates.test.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,3 @@ describe("/delegates", () => {
5454
}
5555
});
5656
});
57-
58-
describe("/delegates/search", () => {
59-
it("should return 10th, 11th, 12th ranked delegates", async () => {
60-
const client = app.resolve(ApiInjectClient);
61-
const response = await client.post("/delegates/search?orderBy=rank:asc", {
62-
rank: [10, 11, 12],
63-
});
64-
65-
expect(response).toMatchObject({
66-
status: 200,
67-
body: {
68-
data: expect.toBeArray(),
69-
},
70-
});
71-
72-
const delegates = response.body.data;
73-
74-
expect(delegates.length).toBe(3);
75-
expect(delegates[0].rank).toBe(10);
76-
expect(delegates[1].rank).toBe(11);
77-
expect(delegates[2].rank).toBe(12);
78-
});
79-
});

__tests__/integration/core-api/controllers/wallets.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -96,60 +96,3 @@ describe("/wallets/:id", () => {
9696
});
9797
});
9898
});
99-
100-
describe("/wallets/search", () => {
101-
it("should return 3 wallets with delegate username genesis_1 or genesis_2 or genesis_3", async () => {
102-
const client = app.resolve(ApiInjectClient);
103-
const response = await client.post("/wallets/search?orderBy=attributes.delegate.username", {
104-
attributes: {
105-
delegate: {
106-
username: ["genesis_1", "genesis_2", "genesis_3"],
107-
},
108-
},
109-
});
110-
111-
expect(response).toMatchObject({
112-
status: 200,
113-
body: {
114-
data: expect.toBeArray(),
115-
},
116-
});
117-
118-
const wallets = response.body.data;
119-
120-
expect(wallets.length).toBe(3);
121-
expect(wallets[0].attributes.delegate.username).toBe("genesis_1");
122-
expect(wallets[1].attributes.delegate.username).toBe("genesis_2");
123-
expect(wallets[2].attributes.delegate.username).toBe("genesis_3");
124-
});
125-
126-
it("should return 5 wallets with delegate rank between 1 and 2, or 10 and 12", async () => {
127-
const client = app.resolve(ApiInjectClient);
128-
const response = await client.post("/wallets/search?orderBy=attributes.delegate.rank", {
129-
attributes: {
130-
delegate: {
131-
rank: [
132-
{ from: 1, to: 2 },
133-
{ from: 10, to: 12 },
134-
],
135-
},
136-
},
137-
});
138-
139-
expect(response).toMatchObject({
140-
status: 200,
141-
body: {
142-
data: expect.toBeArray(),
143-
},
144-
});
145-
146-
const wallets = response.body.data;
147-
148-
expect(wallets.length).toBe(5);
149-
expect(wallets[0].attributes.delegate.rank).toBe(1);
150-
expect(wallets[1].attributes.delegate.rank).toBe(2);
151-
expect(wallets[2].attributes.delegate.rank).toBe(10);
152-
expect(wallets[3].attributes.delegate.rank).toBe(11);
153-
expect(wallets[4].attributes.delegate.rank).toBe(12);
154-
});
155-
});

0 commit comments

Comments
 (0)