Skip to content

Commit

Permalink
refactor(zoe): Populate initialAllocation with empty want properties …
Browse files Browse the repository at this point in the history
…before give properties

This currently has no significant effect because cleanProposal uses
assertKeywordNotInBoth to guarantee disjoint keywords, but we should not
overwrite give amounts when/if that constraint is removed.
  • Loading branch information
gibson042 committed Feb 10, 2024
1 parent 81c909f commit 2165e1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/zoe/src/zoeService/escrowStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ export const provideEscrowStorage = baggage => {
const deposits = await deeplyFulfilledObject(depositPs);

const initialAllocation = harden({
...deposits,
...objectMap(want, amount => AmountMath.makeEmptyFromAmount(amount)),
// Deposits should win in case of overlapping give/want keywords
// (which are not allowed as of 2024-01).
...deposits,
});

return initialAllocation;
Expand Down

0 comments on commit 2165e1e

Please sign in to comment.