Skip to content

Commit

Permalink
test: 💍 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantasdeveloper committed Jul 8, 2024
1 parent 749beb3 commit 48dbdd8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/settlements/dto/asset-leg.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ export class AssetLegDto {
})
@IsEnum(LegType)
readonly type: LegType;

constructor(dto: AssetLegDto) {
Object.assign(this, dto);
}
}
34 changes: 18 additions & 16 deletions src/settlements/settlements.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TxTags,
VenueType,
} from '@polymeshassociation/polymesh-sdk/types';
import { plainToInstance } from 'class-transformer';

import { AssetsService } from '~/assets/assets.service';
import { LegType } from '~/common/types';
Expand Down Expand Up @@ -182,23 +183,24 @@ describe('SettlementsService', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
findVenueSpy.mockResolvedValue(mockVenue as any);

const onChainLeg = {
type: LegType.onChain,
from: new PortfolioDto({ did: 'fromDid', id: new BigNumber(0) }),
to: new PortfolioDto({ did: 'toDid', id: new BigNumber(1) }),
amount: new BigNumber(100),
asset: 'FAKE_TICKER',
};

const offChainLeg = {
type: LegType.offChain,
from: '0x01',
to: '0x02',
offChainAmount: new BigNumber(100),
asset: 'OFF_CHAIN_TICKER',
};

const params = {
legs: [
// new LegDto({
// type: LegType.onChain,
// from: new PortfolioDto({ did: 'fromDid', id: new BigNumber(0) }),
// to: new PortfolioDto({ did: 'toDid', id: new BigNumber(1) }),
// amount: new BigNumber(100),
// asset: 'FAKE_TICKER',
// }),
// new OffChainLegDto({
// type: LegType.offChain,
// from: '0x01',
// to: '0x02',
// offChainAmount: new BigNumber(100),
// asset: 'OFF_CHAIN_TICKER',
// }),
],
legs: [plainToInstance(LegDto, onChainLeg), plainToInstance(OffChainLegDto, offChainLeg)],
};

const body = {
Expand Down

0 comments on commit 48dbdd8

Please sign in to comment.