Skip to content

Commit

Permalink
fix(exo): review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Dec 21, 2023
1 parent b645649 commit bf29a3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
15 changes: 3 additions & 12 deletions packages/exo/test/test-amplify-heap-class-kits.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@ import { M } from '@endo/patterns';
import { defineExoClass, defineExoClassKit } from '../src/exo-makers.js';

const UpCounterI = M.interface('UpCounter', {
incr: M.call()
// TODO M.number() should not be needed to get a better error message
.optional(M.and(M.number(), M.gte(0)))
.returns(M.number()),
incr: M.call().optional(M.gte(0)).returns(M.number()),
});

const DownCounterI = M.interface('DownCounter', {
decr: M.call()
// TODO M.number() should not be needed to get a better error message
.optional(M.and(M.number(), M.gte(0)))
.returns(M.number()),
decr: M.call().optional(M.gte(0)).returns(M.number()),
});

test('test amplify defineExoClass fails', t => {
// let amp;
t.throws(
() =>
defineExoClass(
Expand All @@ -38,9 +31,7 @@ test('test amplify defineExoClass fails', t => {
},
},
{
receiveAmplifier(a) {
// amp = a;
},
receiveAmplifier(_) {},
},
),
{
Expand Down
10 changes: 2 additions & 8 deletions packages/exo/test/test-revoke-heap-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ import { defineExoClass, defineExoClassKit } from '../src/exo-makers.js';
const { apply } = Reflect;

const UpCounterI = M.interface('UpCounter', {
incr: M.call()
// TODO M.number() should not be needed to get a better error message
.optional(M.and(M.number(), M.gte(0)))
.returns(M.number()),
incr: M.call().optional(M.gte(0)).returns(M.number()),
});

const DownCounterI = M.interface('DownCounter', {
decr: M.call()
// TODO M.number() should not be needed to get a better error message
.optional(M.and(M.number(), M.gte(0)))
.returns(M.number()),
decr: M.call().optional(M.gte(0)).returns(M.number()),
});

test('test revoke defineExoClass', t => {
Expand Down

0 comments on commit bf29a3a

Please sign in to comment.