Skip to content

Commit

Permalink
fix: tighten invitation proposal patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Oct 20, 2022
1 parent 052608e commit 61e619c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions packages/inter-protocol/src/psm/psm.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,11 @@ export const start = async (zcf, privateArgs, baggage) => {
wantmintedHook,
'wantMinted',
undefined,
M.split({
harden({
give: { In: anchorAmountShape },
want: M.or({ Out: stableAmountShape }, {}),
multiples: 1n,
exit: M.any(),
}),
);
},
Expand All @@ -286,9 +288,11 @@ export const start = async (zcf, privateArgs, baggage) => {
giveMintedHook,
'giveMinted',
undefined,
M.split({
harden({
give: { In: stableAmountShape },
want: M.or({ Out: anchorAmountShape }, {}),
multiples: 1n,
exit: M.any(),
}),
);
},
Expand Down
6 changes: 3 additions & 3 deletions packages/inter-protocol/test/psm/test-psm.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ test('wrong give giveMintedInvitation', async t => {
),
{
message:
'"giveMinted" proposal: required-parts: give: In: brand: "[Alleged: aUSD brand]" - Must be: "[Alleged: IST brand]"',
'"giveMinted" proposal: give: In: brand: "[Alleged: aUSD brand]" - Must be: "[Alleged: IST brand]"',
},
);
});
Expand Down Expand Up @@ -654,7 +654,7 @@ test('wrong give wantMintedInvitation', async t => {
),
{
message:
'"wantMinted" proposal: required-parts: give: In: brand: "[Alleged: IST brand]" - Must be: "[Alleged: aUSD brand]"',
'"wantMinted" proposal: give: In: brand: "[Alleged: IST brand]" - Must be: "[Alleged: aUSD brand]"',
},
);
});
Expand All @@ -676,7 +676,7 @@ test('extra give wantMintedInvitation', async t => {
),
{
message:
'"wantMinted" proposal: required-parts: give: {"Extra":{"brand":"[Alleged: aUSD brand]","value":"[200000000n]"},"In":{"brand":"[Seen]","value":"[200000000n]"}} - Must not have unexpected properties: ["Extra"]',
'"wantMinted" proposal: give: {"Extra":{"brand":"[Alleged: aUSD brand]","value":"[200000000n]"},"In":{"brand":"[Seen]","value":"[200000000n]"}} - Must not have unexpected properties: ["Extra"]',
},
);
});

0 comments on commit 61e619c

Please sign in to comment.