Skip to content

Commit 1de984e

Browse files
authored
chore: rename invitation descriptions (#2823)
* chore: rename invitation descriptions to meet the requirements for continuing invitations (must be ASCII and capitalized) * chore: add invitationMakers to the offerResult. This will not work from the UI otherwise
1 parent 16755d0 commit 1de984e

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

packages/treasury/src/liquidateMinimum.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function start(zcf) {
9090

9191
const creatorFacet = {
9292
makeDebtorInvitation: runDebt =>
93-
zcf.makeInvitation(makeDebtorHook(runDebt), 'liquidate'),
93+
zcf.makeInvitation(makeDebtorHook(runDebt), 'Liquidate'),
9494
};
9595

9696
return harden({ creatorFacet });

packages/treasury/src/make-empty.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { E } from '@agoric/eventual-send';
66
* @param { ContractFacet } zcf
77
*/
88
export function makeEmptyOfferWithResult(zcf) {
9-
const invitation = zcf.makeInvitation(_ => undefined, 'empty offer');
9+
const invitation = zcf.makeInvitation(_ => undefined, 'EmptyOffer');
1010
const zoe = zcf.getZoeService();
1111
return E(zoe).offer(invitation); // Promise<OfferResultRecord>,
1212
}

packages/treasury/src/stablecoinMachine.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ export async function start(zcf) {
207207
return vm;
208208
}
209209

210-
return zcf.makeInvitation(
211-
addTypeHook,
212-
'add a new kind of collateral to the machine',
213-
);
210+
return zcf.makeInvitation(addTypeHook, 'AddCollateralType');
214211
}
215212

216213
/**
@@ -238,7 +235,7 @@ export async function start(zcf) {
238235
return mgr.makeLoanKit(seat);
239236
}
240237

241-
return zcf.makeInvitation(makeLoanHook, 'make a loan');
238+
return zcf.makeInvitation(makeLoanHook, 'MakeLoan');
242239
}
243240

244241
zcf.setTestJig(() => ({

packages/treasury/src/vault.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export function makeVaultKit(
188188

189189
function makeCloseInvitation() {
190190
assertVaultIsOpen();
191-
return zcf.makeInvitation(closeHook, 'pay off entire loan and close Vault');
191+
return zcf.makeInvitation(closeHook, 'CloseVault');
192192
}
193193

194194
// The proposal is not allowed to include any keys other than these,
@@ -366,7 +366,7 @@ export function makeVaultKit(
366366

367367
function makeAdjustBalancesInvitation() {
368368
assertVaultIsOpen();
369-
return zcf.makeInvitation(adjustBalancesHook, 'adjustBalances');
369+
return zcf.makeInvitation(adjustBalancesHook, 'AdjustBalances');
370370
}
371371

372372
async function openLoan(seat) {

packages/treasury/src/vaultManager.js

+4
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ export function makeVaultManager(
229229
// the payout object
230230
return harden({
231231
uiNotifier: notifier,
232+
invitationMakers: {
233+
AdjustBalances: vault.makeAdjustBalancesInvitation,
234+
CloseVault: vault.makeCloseInvitation,
235+
},
232236
vault,
233237
liquidationPayout: collateralPayoutP,
234238
});

0 commit comments

Comments
 (0)