@@ -5,6 +5,10 @@ import { cleanProposal } from '../../src/cleanProposal.js';
55import { setup } from './setupBasicMints.js' ;
66import buildManualTimer from '../../tools/manualTimer.js' ;
77
8+ /**
9+ * @import {HasBound} from '@agoric/ertp';
10+ */
11+
812const proposeGood = ( t , proposal , assetKind , expected ) =>
913 t . deepEqual (
1014 cleanProposal ( harden ( proposal ) , ( ) => assetKind ) ,
@@ -96,17 +100,20 @@ test('cleanProposal - wrong assetKind', t => {
96100test ( 'cleanProposal - want patterns' , t => {
97101 const { moola, simoleans } = setup ( ) ;
98102 const timer = buildManualTimer ( t . log ) ;
103+ const wantAsset2HasBound = simoleans (
104+ /** @type {HasBound } */ ( M . containerHas ( M . any ( ) ) ) ,
105+ ) ;
99106
100107 proposeGood (
101108 t ,
102109 {
103- want : { Asset2 : M . any ( ) } ,
110+ want : { Asset2 : wantAsset2HasBound } ,
104111 give : { Price2 : moola ( 3n ) } ,
105112 exit : { afterDeadline : { timer, deadline : 100n } } ,
106113 } ,
107114 'nat' ,
108115 {
109- want : { Asset2 : M . any ( ) } ,
116+ want : { Asset2 : wantAsset2HasBound } ,
110117 give : { Price2 : moola ( 3n ) } ,
111118 exit : { afterDeadline : { timer, deadline : 100n } } ,
112119 } ,
@@ -127,22 +134,22 @@ test('cleanProposal - want patterns', t => {
127134 t ,
128135 {
129136 want : { Asset2 : simoleans ( 1n ) } ,
130- give : { Price2 : M . any ( ) } ,
137+ give : { Price2 : M . containerHas ( M . any ( ) ) } ,
131138 exit : { afterDeadline : { timer, deadline : 100n } } ,
132139 } ,
133140 'nat' ,
134- 'A passable tagged "match:any " is not a key: "[match:any ]"' ,
141+ 'A passable tagged "match:containerHas " is not a key: "[match:containerHas ]"' ,
135142 ) ;
136143
137144 proposeBad (
138145 t ,
139146 {
140147 want : { Asset2 : simoleans ( 1n ) } ,
141- give : { Price2 : M . any ( ) } ,
148+ give : { Price2 : M . containerHas ( M . any ( ) ) } ,
142149 exit : { afterDeadline : { timer, deadline : M . any ( ) } } ,
143150 } ,
144151 'nat' ,
145- 'A passable tagged "match:any " is not a key: "[match:any ]"' ,
152+ 'A passable tagged "match:containerHas " is not a key: "[match:containerHas ]"' ,
146153 ) ;
147154} ) ;
148155
0 commit comments