@@ -19,10 +19,10 @@ use rgb::psbt::RgbExt;
19
19
use rgb:: schema:: { OwnedRightType , TransitionType } ;
20
20
use rgb:: seal:: Revealed ;
21
21
use rgb:: {
22
- bundle, validation, Anchor , Assignment , BundleId , Consignment , ConsignmentType , ContractId ,
23
- ContractState , ContractStateMap , Disclosure , Genesis , InmemConsignment , Node , NodeId ,
24
- OwnedRights , PedersenStrategy , Schema , SchemaId , SealEndpoint , StateTransfer , Transition ,
25
- TransitionBundle , TypedAssignments , Validator , Validity ,
22
+ bundle, validation, Anchor , Assignment , AttachmentStrategy , BundleId , Consignment ,
23
+ ConsignmentType , ContractId , ContractState , ContractStateMap , Disclosure , Genesis ,
24
+ InmemConsignment , Node , NodeId , OwnedRights , PedersenStrategy , Schema , SchemaId , SealEndpoint ,
25
+ StateTransfer , Transition , TransitionBundle , TypedAssignments , Validator , Validity ,
26
26
} ;
27
27
use rgb_rpc:: { FinalizeTransfersRes , OutpointFilter , Reveal , TransferFinalize } ;
28
28
use storm:: chunk:: ChunkIdExt ;
@@ -282,30 +282,59 @@ impl Runtime {
282
282
283
283
let mut owned_rights: BTreeMap < OwnedRightType , TypedAssignments > = bmap ! { } ;
284
284
for ( owned_type, assignments) in transition. owned_rights ( ) . iter ( ) {
285
- let outpoints = assignments. to_value_assignments ( ) ;
286
-
287
- let mut revealed_assignment: Vec < Assignment < PedersenStrategy > > =
288
- empty ! ( ) ;
289
-
290
- for out in outpoints {
291
- if out. commit_conceal ( ) . to_confidential_seal ( )
292
- != reveal_outpoint. to_concealed_seal ( )
293
- {
294
- revealed_assignment. push ( out) ;
295
- } else {
296
- let accept = match out. as_revealed_state ( ) {
297
- Some ( seal) => Assignment :: Revealed {
298
- seal : reveal_outpoint,
299
- state : * seal,
300
- } ,
301
- _ => out,
302
- } ;
303
- revealed_assignment. push ( accept) ;
285
+ match assignments {
286
+ TypedAssignments :: Value ( outpoints) => {
287
+ let mut assignment: Vec < Assignment < PedersenStrategy > > =
288
+ empty ! ( ) ;
289
+
290
+ for out in outpoints. clone ( ) {
291
+ if out. commit_conceal ( ) . to_confidential_seal ( )
292
+ != reveal_outpoint. to_concealed_seal ( )
293
+ {
294
+ assignment. push ( out) ;
295
+ } else {
296
+ let accept = match out. as_revealed_state ( ) {
297
+ Some ( seal) => Assignment :: Revealed {
298
+ seal : reveal_outpoint,
299
+ state : * seal,
300
+ } ,
301
+ _ => out,
302
+ } ;
303
+ assignment. push ( accept) ;
304
+ }
305
+ }
306
+
307
+ owned_rights
308
+ . insert ( * owned_type, TypedAssignments :: Value ( assignment) ) ;
304
309
}
310
+ TypedAssignments :: Attachment ( outpoints) => {
311
+ let mut assignment: Vec < Assignment < AttachmentStrategy > > =
312
+ empty ! ( ) ;
313
+
314
+ for out in outpoints. clone ( ) {
315
+ if out. commit_conceal ( ) . to_confidential_seal ( )
316
+ != reveal_outpoint. to_concealed_seal ( )
317
+ {
318
+ assignment. push ( out) ;
319
+ } else {
320
+ let accept = match out. as_revealed_state ( ) {
321
+ Some ( seal) => Assignment :: Revealed {
322
+ seal : reveal_outpoint,
323
+ state : seal. clone ( ) ,
324
+ } ,
325
+ _ => out,
326
+ } ;
327
+ assignment. push ( accept) ;
328
+ }
329
+ }
330
+
331
+ owned_rights. insert (
332
+ * owned_type,
333
+ TypedAssignments :: Attachment ( assignment) ,
334
+ ) ;
335
+ }
336
+ _ => { }
305
337
}
306
-
307
- owned_rights
308
- . insert ( * owned_type, TypedAssignments :: Value ( revealed_assignment) ) ;
309
338
}
310
339
311
340
let tmp: Transition = Transition :: with (
0 commit comments