Skip to content

Commit

Permalink
fix: morphoblue token test for logoUri
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Lu committed Jun 25, 2024
1 parent 0841e6d commit b9334c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/logics/morphoblue/supply-collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as core from '@protocolink/core';
import { expect } from 'chai';
import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';
import omit from 'lodash/omit';
import * as utils from 'test/utils';

describe('mainnet-pb: Test Morphoblue SupplyCollateral Logic', function () {
Expand Down Expand Up @@ -68,7 +69,10 @@ describe('mainnet-pb: Test Morphoblue SupplyCollateral Logic', function () {
await expect(user.sendTransaction(transactionRequest)).to.not.be.reverted;
await expect(user.address).to.changeBalance(input.token, -input.amount);
const collateralBalance = await service.getCollateralBalance(marketId, user.address);
expect(collateralBalance).to.be.deep.eq(new common.TokenAmount(input.token.wrapped, input.amount));
expect(collateralBalance.amount).eq(input.amount);
expect(JSON.stringify(omit(collateralBalance.token.toObject(), 'logoUri'))).eq(
JSON.stringify(omit(input.token.toObject(), 'logoUri'))
);
});
});
});
5 changes: 5 additions & 0 deletions test/logics/morphoblue/supply.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as core from '@protocolink/core';
import { expect } from 'chai';
import hre from 'hardhat';
import * as morphoblue from 'src/logics/morphoblue';
import omit from 'lodash/omit';
import * as utils from 'test/utils';

describe('mainnet-pb: Test Morphoblue Supply Logic', function () {
Expand Down Expand Up @@ -76,6 +77,10 @@ describe('mainnet-pb: Test Morphoblue Supply Logic', function () {
await expect(user.address).to.changeBalance(input.token, -input.amount);
const supplyBalance = await service.getSupplyBalance(marketId, user.address);
expect(supplyBalance).to.be.deep.eq(new common.TokenAmount(input.token.wrapped, input.amount));
expect(supplyBalance.amount).eq(input.amount);
expect(JSON.stringify(omit(supplyBalance.token.toObject(), 'logoUri'))).eq(
JSON.stringify(omit(input.token.toObject(), 'logoUri'))
);
});
});
});

0 comments on commit b9334c4

Please sign in to comment.