Skip to content

Commit

Permalink
fix: minor adjustments from purple day1 (#4271)
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Jan 11, 2022
1 parent 6087647 commit 72cc8d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions packages/store/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* category of Amounts. And "AmountPatternShape" represents the
* category of patterns over Amounts.
*
* * I say "indended" above because Patterns, in order to be declarative
* * I say "intended" above because Patterns, in order to be declarative
* and passable, cannot have the generality of predicates written in a
* Turing-universal programming language. Rather, to represent the category of
* things intended to be a Foo, a FooShape should reliably
Expand Down Expand Up @@ -281,8 +281,9 @@

/**
* @typedef {RankCompare} FullCompare
* A `FullCompare` function satisfies all the invariants stated above for
* `RankCompare`. In addition, its equality is as precise as the `KeyCompare`
* A `FullCompare` function satisfies all the invariants stated below for
* `RankCompare`'s relation with KeyCompare.
* In addition, its equality is as precise as the `KeyCompare`
* comparison defined below, in that, for all Keys `x` and `y`,
* `FullCompare(x, y) === 0` iff `KeyCompare(x, y) === 0`.
*
Expand Down
10 changes: 7 additions & 3 deletions packages/zoe/src/typeGuards.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import { AmountShape } from '@agoric/ertp';
import { M } from '@agoric/store';

export const AmountRecordKeywordShape = M.recordOf(M.string(), AmountShape);
export const AmountKeywordRecordShape = M.recordOf(M.string(), AmountShape);
export const AmountPatternKeywordRecordShape = M.recordOf(
M.string(),
M.pattern(),
);

/**
* After defaults are filled in
*/
export const ProposalShape = harden({
want: M.recordOf(M.string(), M.pattern()),
give: AmountRecordKeywordShape,
want: AmountPatternKeywordRecordShape,
give: AmountKeywordRecordShape,
// To accept only one, we could use M.or rather than M.partial,
// but the error messages would have been worse. Rather,
// cleanProposal's assertExit checks that there's exactly one.
Expand Down

0 comments on commit 72cc8d6

Please sign in to comment.