Skip to content

Commit 22fc9d3

Browse files
authored
Remove network fees related js code from the rest module (#12568)
Remove network fees js endpoint code from the rest module, since we now have the rest-java equivalent. --------- Signed-off-by: sdimitrov9 <[email protected]>
1 parent 33c5b99 commit 22fc9d3

31 files changed

+7
-1283
lines changed

charts/hedera-mirror-rest-java/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ gateway:
8181
- path:
8282
type: RegularExpression
8383
value: '/api/v1/network/exchangerate'
84-
{{- if .Values.routes.fees }}
8584
- path:
8685
type: RegularExpression
8786
value: '/api/v1/network/fees$'
88-
{{- end }}
8987
- path:
9088
type: RegularExpression
9189
value: '/api/v1/network/stake$'
@@ -145,7 +143,6 @@ ingress:
145143
- path: '/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/hooks/(0|[1-9]\d*)/storage'
146144
- path: '/api/v1/network/exchangerate'
147145
- path: '/api/v1/network/fees$'
148-
condition: "{{ .Values.routes.fees }}"
149146
- path: '/api/v1/network/stake$'
150147
- path: '/api/v1/network/supply$'
151148
condition: "{{ .Values.routes.supply }}"
@@ -330,7 +327,6 @@ resources:
330327
revisionHistoryLimit: 3
331328

332329
routes:
333-
fees: true
334330
supply: false
335331

336332
securityContext:

rest/__tests__/controllers/networkController.test.js

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import * as constants from '../../constants';
44
import {NetworkController} from '../../controllers';
5-
import {FileData} from '../../model';
65
import networkCtrl from '../../controllers/networkController';
76
import * as utils from '../../utils';
87
import EntityId from '../../entityId.js';
@@ -165,125 +164,6 @@ describe('validateExtractNetworkNodesQuery throw', () => {
165164
});
166165
});
167166

168-
describe('extractFileDataQuery', () => {
169-
const defaultExpected = {
170-
filterQuery: {
171-
whereQuery: [],
172-
},
173-
order: constants.orderFilterValues.ASC,
174-
};
175-
176-
const specs = [
177-
{
178-
name: 'no timestamp',
179-
input: {
180-
filters: [],
181-
},
182-
expected: {
183-
...defaultExpected,
184-
},
185-
},
186-
{
187-
name: 'le timestamp',
188-
input: {
189-
filters: [
190-
{
191-
key: constants.filterKeys.TIMESTAMP,
192-
operator: utils.opsMap.lt,
193-
value: 2,
194-
},
195-
],
196-
},
197-
expected: {
198-
...defaultExpected,
199-
filterQuery: {
200-
whereQuery: [
201-
{
202-
query: `${FileData.CONSENSUS_TIMESTAMP} < `,
203-
param: 2,
204-
},
205-
],
206-
},
207-
},
208-
},
209-
{
210-
name: 'lte timestamp',
211-
input: {
212-
filters: [
213-
{
214-
key: constants.filterKeys.TIMESTAMP,
215-
operator: utils.opsMap.lte,
216-
value: 2,
217-
},
218-
],
219-
},
220-
expected: {
221-
...defaultExpected,
222-
filterQuery: {
223-
whereQuery: [
224-
{
225-
query: `${FileData.CONSENSUS_TIMESTAMP} <= `,
226-
param: 2,
227-
},
228-
],
229-
},
230-
},
231-
},
232-
{
233-
name: 'gt timestamp',
234-
input: {
235-
filters: [
236-
{
237-
key: constants.filterKeys.TIMESTAMP,
238-
operator: utils.opsMap.gt,
239-
value: 2,
240-
},
241-
],
242-
},
243-
expected: {
244-
...defaultExpected,
245-
filterQuery: {
246-
whereQuery: [
247-
{
248-
query: `${FileData.CONSENSUS_TIMESTAMP} > `,
249-
param: 2,
250-
},
251-
],
252-
},
253-
},
254-
},
255-
{
256-
name: 'gte timestamp',
257-
input: {
258-
filters: [
259-
{
260-
key: constants.filterKeys.TIMESTAMP,
261-
operator: utils.opsMap.gte,
262-
value: 2,
263-
},
264-
],
265-
},
266-
expected: {
267-
...defaultExpected,
268-
filterQuery: {
269-
whereQuery: [
270-
{
271-
query: `${FileData.CONSENSUS_TIMESTAMP} >= `,
272-
param: 2,
273-
},
274-
],
275-
},
276-
},
277-
},
278-
];
279-
280-
specs.forEach((spec) => {
281-
test(`${spec.name}`, () => {
282-
expect(networkCtrl.extractFileDataQuery(spec.input.filters)).toEqual(spec.expected);
283-
});
284-
});
285-
});
286-
287167
describe('convertToCurrencyFormat', () => {
288168
it.each`
289169
tinycoins | currencyFormat | expected

rest/__tests__/model/feeSchedule.test.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

rest/__tests__/non-zero-shard-realm.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ describe('System Entities', () => {
9797
expect(EntityId.systemEntity.exchangeRateFile.toString()).toEqual('1.2.112');
9898
});
9999

100-
test('feeScheduleFile', () => {
101-
expect(EntityId.systemEntity.feeScheduleFile.toString()).toEqual('1.2.111');
102-
});
103-
104100
test('stakingRewardAccount', () => {
105101
expect(EntityId.systemEntity.stakingRewardAccount.toString()).toEqual('1.2.800');
106102
});

rest/__tests__/service/fileDataService.test.js

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -117,98 +117,3 @@ describe('FileDataService.getLatestFileDataContents tests', () => {
117117
);
118118
});
119119
});
120-
121-
const feeScheduleFiles = [
122-
{
123-
consensus_timestamp: 1,
124-
entity_id: 111,
125-
file_data: Buffer.from('0a280a0a08541a061a0440a8953a0a0a08061a061a0440a8aa330a0a', 'hex'),
126-
transaction_type: 17,
127-
},
128-
{
129-
consensus_timestamp: 2,
130-
entity_id: 111,
131-
file_data: Buffer.from('08071a061a0440c0843d120208011200', 'hex'),
132-
transaction_type: 16,
133-
},
134-
{
135-
consensus_timestamp: 3,
136-
entity_id: 111,
137-
file_data: Buffer.from('0a220a0808541a041a0240150a0808061a041a0240010a0808071a041a02400112020801', 'hex'),
138-
transaction_type: 19,
139-
},
140-
{
141-
consensus_timestamp: 4,
142-
entity_id: 111,
143-
file_data: Buffer.from(
144-
'0a280a0a08541a061a04408888340a0a08061a061a0440889d2d0a0a08071a061a0440b0b63c120208011200',
145-
'hex'
146-
),
147-
transaction_type: 19,
148-
},
149-
];
150-
151-
const expectedFeeSchedulePreviousFile = {
152-
timestamp: 2,
153-
current_feeSchedule: [
154-
{
155-
fees: [{servicedata: {gas: {low: 953000}}}],
156-
hederaFunctionality: 84,
157-
},
158-
{
159-
fees: [{servicedata: {gas: {low: 841000}}}],
160-
hederaFunctionality: 6,
161-
},
162-
{
163-
fees: [{servicedata: {gas: {low: 1000000}}}],
164-
hederaFunctionality: 7,
165-
},
166-
],
167-
next_feeSchedule: [],
168-
};
169-
170-
const expectedFeeScheduleLatestFile = {
171-
timestamp: 4,
172-
current_feeSchedule: [
173-
{
174-
fees: [{servicedata: {gas: {low: 853000}}}],
175-
hederaFunctionality: 84,
176-
},
177-
{
178-
fees: [{servicedata: {gas: {low: 741000}}}],
179-
hederaFunctionality: 6,
180-
},
181-
{
182-
fees: [{servicedata: {gas: {low: 990000}}}],
183-
hederaFunctionality: 7,
184-
},
185-
],
186-
next_feeSchedule: [],
187-
};
188-
189-
describe('FileDataService.getFeeSchedule', () => {
190-
test('FileDataService.getFeeSchedule - No match', async () => {
191-
await expect(FileDataService.getFeeSchedule({whereQuery: []})).resolves.toBeNull();
192-
});
193-
194-
test('FileDataService.getFeeSchedule - Row match w latest', async () => {
195-
await integrationDomainOps.loadFileData(feeScheduleFiles);
196-
await expect(FileDataService.getFeeSchedule({whereQuery: []})).resolves.toMatchObject(
197-
expectedFeeScheduleLatestFile
198-
);
199-
});
200-
201-
test('FileDataService.getFeeSchedule - Row match w previous latest', async () => {
202-
await integrationDomainOps.loadFileData(feeScheduleFiles);
203-
204-
const where = [
205-
{
206-
query: `${FileData.CONSENSUS_TIMESTAMP} <= `,
207-
param: expectedFeeSchedulePreviousFile.timestamp,
208-
},
209-
];
210-
await expect(FileDataService.getFeeSchedule({whereQuery: where})).resolves.toMatchObject(
211-
expectedFeeSchedulePreviousFile
212-
);
213-
});
214-
});

0 commit comments

Comments
 (0)