update TradeInfo isDepositsConfirmed, isDepositsUnlocked()

This commit is contained in:
woodser 2023-01-29 18:06:50 -05:00
parent 2cfee9d1b1
commit 39f510a7b3

View file

@ -250,7 +250,7 @@ interface TradeContext {
payoutState?: string[], payoutState?: string[],
disputeState?: string, disputeState?: string,
isCompleted?: boolean, isCompleted?: boolean,
isPayoutPublished?: boolean, // TODO: test isDepositPublished, etc isPayoutPublished?: boolean, // TODO: test isDepositsPublished, etc
isPayoutConfirmed?: boolean, isPayoutConfirmed?: boolean,
isPayoutUnlocked?: boolean isPayoutUnlocked?: boolean
buyerOpenedDispute?: boolean, buyerOpenedDispute?: boolean,
@ -1977,14 +1977,14 @@ async function executeTrade(ctx?: TradeContext): Promise<string> {
if (getBuyer(ctx)) { if (getBuyer(ctx)) {
expect((await getBuyer(ctx)!.getTrade(ctx.offer!.getId())).getPhase()).toEqual(expectedState); expect((await getBuyer(ctx)!.getTrade(ctx.offer!.getId())).getPhase()).toEqual(expectedState);
fetchedTrade = await getBuyer(ctx)!.getTrade(ctx.offerId!); fetchedTrade = await getBuyer(ctx)!.getTrade(ctx.offerId!);
expect(fetchedTrade.getIsDepositUnlocked()).toBe(true); expect(fetchedTrade.getIsDepositsUnlocked()).toBe(true);
expect(fetchedTrade.getPhase()).toEqual(expectedState); expect(fetchedTrade.getPhase()).toEqual(expectedState);
} }
// test seller trade state if online // test seller trade state if online
if (getSeller(ctx)) { if (getSeller(ctx)) {
fetchedTrade = await getSeller(ctx)!.getTrade(trade.getTradeId()); fetchedTrade = await getSeller(ctx)!.getTrade(trade.getTradeId());
expect(fetchedTrade.getIsDepositUnlocked()).toBe(true); expect(fetchedTrade.getIsDepositsUnlocked()).toBe(true);
expect(fetchedTrade.getPhase()).toEqual(expectedState); expect(fetchedTrade.getPhase()).toEqual(expectedState);
} }