Skip to content

Commit

Permalink
fixup! test: repair test for smartWallet changes: throw propogates
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Dec 6, 2023
1 parent 694452b commit 8619d8c
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions packages/boot/test/bootstrapTests/test-vaults-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,15 @@ test('close vault', async t => {
'Offer {"brand":"[Alleged: IST brand]","value":"[1n]"} is not sufficient to pay off debt {"brand":"[Alleged: IST brand]","value":"[5025000n]"}';

await t.throwsAsync(
() =>
wd.executeOfferMaker(
Offers.vaults.CloseVault,
{
offerId: 'close-insufficient',
collateralBrandKey,
giveMinted: 0.000_001,
},
'open-vault',
),
wd.executeOfferMaker(
Offers.vaults.CloseVault,
{
offerId: 'close-insufficient',
collateralBrandKey,
giveMinted: 0.000_001,
},
'open-vault',
),
{ message },
);

Expand Down Expand Up @@ -236,17 +235,13 @@ test('open vault with insufficient funds gives helpful error', async t => {
'Proposed debt {"brand":"[Alleged: IST brand]","value":"[904500000n]"} exceeds max {"brand":"[Alleged: IST brand]","value":"[63462857n]"} for {"brand":"[Alleged: ATOM brand]","value":"[9000000n]"} collateral';

await t.throwsAsync(
() =>
wd.executeOfferMaker(Offers.vaults.OpenVault, {
offerId: 'open-vault',
collateralBrandKey,
giveCollateral,
wantMinted,
}),
{
message:
'Proposed debt {"brand":"[Alleged: IST brand]","value":"[904500000n]"} exceeds max {"brand":"[Alleged: IST brand]","value":"[63462857n]"} for {"brand":"[Alleged: ATOM brand]","value":"[9000000n]"} collateral',
},
wd.executeOfferMaker(Offers.vaults.OpenVault, {
offerId: 'open-vault',
collateralBrandKey,
giveCollateral,
wantMinted,
}),
{ message },
);

t.like(wd.getLatestUpdateRecord(), {
Expand Down

0 comments on commit 8619d8c

Please sign in to comment.