Skip to content

Commit

Permalink
chore(watcher-service): fix code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed Dec 30, 2023
1 parent 2a07346 commit 35fc979
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
6 changes: 2 additions & 4 deletions services/watcher/tests/api/revenues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ describe('revenueRouter', () => {
// send a request to the endpoint
const res = await request(app).get('/revenue');

console.warn(res);

// check the result
expect(res.status).to.eql(200);
const resultParsed = JSON.parse(res.text);
Expand Down Expand Up @@ -100,9 +98,9 @@ describe('revenueRouter', () => {
// check the result
expect(res.status).to.eql(200);
const resultParsed = JSON.parse(res.text);
expect(resultParsed.total).to.eql(4);
expect(resultParsed.total).to.eql(3);
const revenueIds = resultParsed.items.map((revenue: any) => revenue.id);
expect(revenueIds).to.eql([4, 3]);
expect(revenueIds).to.eql([3]);
});

/**
Expand Down
4 changes: 2 additions & 2 deletions services/watcher/tests/api/testDataEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const events = [
boxSerialized: 'box2',
block: 'blockID2',
height: 100,
fromChain: 'ergo',
fromChain: 'cardano',
toChain: 'toChain',
fromAddress: 'fromAddress',
toAddress: 'toAddressStar',
Expand Down Expand Up @@ -144,7 +144,7 @@ const events = [
boxSerialized: 'box',
block: 'blockID',
height: 100,
fromChain: 'ergo',
fromChain: 'cardano',
toChain: 'toChain',
fromAddress: 'fromAddressStar',
toAddress: 'toAddress',
Expand Down
4 changes: 2 additions & 2 deletions services/watcher/tests/database/mockedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ eventTriggerEntity.networkFee = '1000';
eventTriggerEntity.bridgeFee = '200';
eventTriggerEntity.fromAddress = 'fromAddressStar';
eventTriggerEntity.toAddress = 'toAddress';
eventTriggerEntity.fromChain = 'ergo';
eventTriggerEntity.fromChain = 'cardano';
eventTriggerEntity.toChain = 'toChain';
eventTriggerEntity.sourceChainTokenId = 'tokenId2';
eventTriggerEntity.targetChainTokenId = 'targetTokenId';
Expand All @@ -211,7 +211,7 @@ newEventTriggerEntity.networkFee = '1000';
newEventTriggerEntity.bridgeFee = '200';
newEventTriggerEntity.fromAddress = 'fromAddress';
newEventTriggerEntity.toAddress = 'toAddressStar';
newEventTriggerEntity.fromChain = 'ergo';
newEventTriggerEntity.fromChain = 'cardano';
newEventTriggerEntity.toChain = 'toChain';
newEventTriggerEntity.sourceChainTokenId = 'tokenId';
newEventTriggerEntity.targetChainTokenId = 'targetTokenId';
Expand Down
22 changes: 11 additions & 11 deletions services/watcher/tests/ergo/statistics/mockUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,17 @@ const firstRevenue = {
wid: 'WIDStatistics',
eventId: 'ab59962c20f57d9d59e95f5170ccb3472df4279ad4967e51ba8be9ba75144c7b',
lockHeight: 123457,
fromChain: 'ergo',
fromChain: 'cardano',
toChain: 'toChain',
fromAddress: 'fromAddress',
toAddress: 'toAddressStar',
amount: '100',
bridgeFee: '200',
networkFee: '1000',
lockToken: {
decimals: 6,
decimals: 0,
isNativeToken: false,
name: 'test token 10',
name: 'Unsupported token',
tokenId: 'tokenId',
},
lockTxId: 'txId2',
Expand Down Expand Up @@ -255,9 +255,9 @@ const lastRevenue = {
bridgeFee: '200',
networkFee: '1000',
lockToken: {
decimals: 6,
decimals: 0,
isNativeToken: false,
name: 'test token 10',
name: 'Unsupported token',
tokenId: 'tokenId',
},
lockTxId: 'txIdStar',
Expand All @@ -277,17 +277,17 @@ const tokenId2Revenue = {
permitTxId: 'txId',
eventId: 'ab59962c20f57d9d59e95f5170ccb3472df4279ad4967e51ba8be9ba75144c7b',
lockHeight: 123457,
fromChain: 'ergo',
fromChain: 'cardano',
toChain: 'toChain',
fromAddress: 'fromAddressStar',
toAddress: 'toAddress',
amount: '100',
bridgeFee: '200',
networkFee: '1000',
lockToken: {
decimals: 6,
decimals: 0,
isNativeToken: false,
name: 'test token 10',
name: 'Unsupported token',
tokenId: 'tokenId',
},
lockTxId: 'txId',
Expand All @@ -307,17 +307,17 @@ const secondTokenId2Revenue = {
permitTxId: 'txId',
eventId: 'ab59962c20f57d9d59e95f5170ccb3472df4279ad4967e51ba8be9ba75144c7b',
lockHeight: 123457,
fromChain: 'ergo',
fromChain: 'cardano',
toChain: 'toChain',
fromAddress: 'fromAddressStar',
toAddress: 'toAddress',
amount: '100',
bridgeFee: '200',
networkFee: '1000',
lockToken: {
decimals: 6,
decimals: 0,
isNativeToken: false,
name: 'test token 10',
name: 'Unsupported token',
tokenId: 'tokenId',
},
lockTxId: 'txId',
Expand Down

0 comments on commit 35fc979

Please sign in to comment.