Skip to content

Commit

Permalink
MEX-672: fix fees collector unit tests price inconsistencies
Browse files Browse the repository at this point in the history
Signed-off-by: Claudiu Lataretu <[email protected]>
  • Loading branch information
claudiulataretu committed Feb 10, 2025
1 parent 1948f01 commit 9aab55c
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ describe('FeesCollectorComputeService', () => {
);
const energyService = module.get<EnergyService>(EnergyService);

jest.spyOn(tokenCompute, 'tokenPriceDerivedUSD').mockImplementation(
(tokenID) => {
return Promise.resolve(priceMap.get(tokenID));
},
);
jest.spyOn(
tokenCompute,
'computeTokenPriceDerivedUSD',
Expand Down Expand Up @@ -313,6 +318,11 @@ describe('FeesCollectorComputeService', () => {
);
const energyService = module.get<EnergyService>(EnergyService);

jest.spyOn(tokenCompute, 'tokenPriceDerivedUSD').mockImplementation(
(tokenID) => {
return Promise.resolve(priceMap.get(tokenID));
},
);
jest.spyOn(
tokenCompute,
'computeTokenPriceDerivedUSD',
Expand Down Expand Up @@ -378,6 +388,11 @@ describe('FeesCollectorComputeService', () => {
);
const energyService = module.get<EnergyService>(EnergyService);

jest.spyOn(tokenCompute, 'tokenPriceDerivedUSD').mockImplementation(
(tokenID) => {
return Promise.resolve(priceMap.get(tokenID));
},
);
jest.spyOn(
tokenCompute,
'computeTokenPriceDerivedUSD',
Expand Down Expand Up @@ -415,12 +430,6 @@ describe('FeesCollectorComputeService', () => {
' with 0 user energy and locked tokens',
async () => {
const user1 = 'erd1';
const mex = 'MEX-123456';
const priceMap = new Map<string, string>();
priceMap.set('WEGLD-123456', '10');
priceMap.set('MEX-123456', '20');
priceMap.set('TOK4-123456', '30');
priceMap.set(mex, '1');

const service = module.get<FeesCollectorComputeService>(
FeesCollectorComputeService,
Expand Down

0 comments on commit 9aab55c

Please sign in to comment.