Skip to content

Commit

Permalink
Merge pull request #7450 from Agoric/7046-dist-args
Browse files Browse the repository at this point in the history
fix feeDistributor bootstrap
  • Loading branch information
mergify[bot] authored Apr 19, 2023
2 parents e658480 + 7d0dd55 commit 470ca41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/feeDistributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export const makeFeeDistributor = (feeIssuer, terms) => {
},

/**
* @param {Record<Keyword, FeeDestination>} newDestinations
* @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
*/
setDestinations: async newDestinations => {
destinations = newDestinations;
Expand Down
20 changes: 14 additions & 6 deletions packages/inter-protocol/src/proposals/econ-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export const startRewardDistributor = async ({
timerService,
collectionInterval: 60n * 60n, // 1 hour
keywordShares: {
RewardDistributor: 1n,
RewardDistributor: 0n,
Reserve: 1n,
},
}),
Expand All @@ -417,20 +417,28 @@ export const startRewardDistributor = async ({
return undefined;
});

/**
* @type {Awaited<
* ReturnType<typeof import('../feeDistributor.js').makeFeeDistributor>>
* & { adminFacet: AdminFacet, instance: Instance }
* }
*/
const instanceKit = await E(zoe).startInstance(
feeDistributor,
{ Fee: centralIssuer },
feeDistributorTerms,
undefined,
'feeDistributor',
);
/** @type {ERef<import('../feeDistributor.js').FeeDestination>} */
await E(instanceKit.creatorFacet).setDestinations({
RewardDistributor:
rewardDistributorDepositFacet &&
E(instanceKit.creatorFacet).makeDepositFacetDestination(
rewardDistributorDepositFacet,
),
...(rewardDistributorDepositFacet && {
RewardDistributor: E(
instanceKit.creatorFacet,
).makeDepositFacetDestination(rewardDistributorDepositFacet),
}),
Reserve: E(instanceKit.creatorFacet).makeOfferDestination(
zoe,
'Collateral',
E.get(reserveKit).publicFacet,
'makeAddCollateralInvitation',
Expand Down

0 comments on commit 470ca41

Please sign in to comment.