@@ -22,7 +22,11 @@ use crate::document::{
22
22
extended_document:: v0:: ExtendedDocumentV0 ,
23
23
serialization_traits:: DocumentPlatformConversionMethodsV0 , ExtendedDocument ,
24
24
} ;
25
+ use crate :: fee:: Credits ;
25
26
use crate :: prelude:: { BlockHeight , CoreBlockHeight , TimestampMillis } ;
27
+ use crate :: state_transition:: documents_batch_transition:: document_transition:: {
28
+ DocumentPurchaseTransition , DocumentTransferTransition , DocumentUpdatePriceTransition ,
29
+ } ;
26
30
#[ cfg( feature = "state-transitions" ) ]
27
31
use crate :: state_transition:: documents_batch_transition:: {
28
32
document_transition:: {
@@ -32,8 +36,6 @@ use crate::state_transition::documents_batch_transition::{
32
36
DocumentsBatchTransition , DocumentsBatchTransitionV0 ,
33
37
} ;
34
38
use itertools:: Itertools ;
35
- use crate :: fee:: Credits ;
36
- use crate :: state_transition:: documents_batch_transition:: document_transition:: { DocumentPurchaseTransition , DocumentTransferTransition , DocumentUpdatePriceTransition } ;
37
39
38
40
const PROPERTY_FEATURE_VERSION : & str = "$version" ;
39
41
const PROPERTY_ENTROPY : & str = "$entropy" ;
@@ -213,7 +215,7 @@ impl DocumentFactoryV0 {
213
215
> ,
214
216
nonce_counter : & mut BTreeMap < ( Identifier , Identifier ) , u64 > , //IdentityID/ContractID -> nonce,
215
217
recipient : Option < Identifier > ,
216
- price : Option < Credits >
218
+ price : Option < Credits > ,
217
219
) -> Result < DocumentsBatchTransition , ProtocolError > {
218
220
let platform_version = PlatformVersion :: get ( self . protocol_version ) ?;
219
221
let documents: Vec < (
@@ -273,17 +275,19 @@ impl DocumentFactoryV0 {
273
275
. collect ( ) ,
274
276
nonce_counter,
275
277
platform_version,
276
- recipient
277
- ) ,
278
- DocumentTransitionActionType :: UpdatePrice => Self :: document_update_price_transitions (
279
- documents
280
- . into_iter ( )
281
- . map ( |( document, document_type, _) | ( document, document_type) )
282
- . collect ( ) ,
283
- nonce_counter,
284
- platform_version,
285
- price
278
+ recipient,
286
279
) ,
280
+ DocumentTransitionActionType :: UpdatePrice => {
281
+ Self :: document_update_price_transitions (
282
+ documents
283
+ . into_iter ( )
284
+ . map ( |( document, document_type, _) | ( document, document_type) )
285
+ . collect ( ) ,
286
+ nonce_counter,
287
+ platform_version,
288
+ price,
289
+ )
290
+ }
287
291
DocumentTransitionActionType :: Purchase => Self :: document_purchase_transitions (
288
292
documents
289
293
. into_iter ( )
@@ -292,14 +296,15 @@ impl DocumentFactoryV0 {
292
296
nonce_counter,
293
297
platform_version,
294
298
price,
295
- recipient
299
+ recipient,
296
300
) ,
297
301
_ => {
298
302
let action_type_name: & str = action. into ( ) ;
299
303
300
304
Err ( ProtocolError :: InvalidStateTransitionType (
301
305
action_type_name. to_string ( ) ,
302
- ) ) } ,
306
+ ) )
307
+ }
303
308
} )
304
309
. collect :: < Result < Vec < _ > , ProtocolError > > ( ) ?
305
310
. into_iter ( )
@@ -588,7 +593,7 @@ impl DocumentFactoryV0 {
588
593
documents : Vec < ( Document , DocumentTypeRef ) > ,
589
594
nonce_counter : & mut BTreeMap < ( Identifier , Identifier ) , u64 > , //IdentityID/ContractID -> nonce
590
595
platform_version : & PlatformVersion ,
591
- recipient_owner_id : Option < Identifier >
596
+ recipient_owner_id : Option < Identifier > ,
592
597
) -> Result < Vec < DocumentTransition > , ProtocolError > {
593
598
documents
594
599
. into_iter ( )
@@ -635,7 +640,7 @@ impl DocumentFactoryV0 {
635
640
documents : Vec < ( Document , DocumentTypeRef ) > ,
636
641
nonce_counter : & mut BTreeMap < ( Identifier , Identifier ) , u64 > , //IdentityID/ContractID -> nonce
637
642
platform_version : & PlatformVersion ,
638
- price : Option < Credits >
643
+ price : Option < Credits > ,
639
644
) -> Result < Vec < DocumentTransition > , ProtocolError > {
640
645
documents
641
646
. into_iter ( )
@@ -680,7 +685,7 @@ impl DocumentFactoryV0 {
680
685
nonce_counter : & mut BTreeMap < ( Identifier , Identifier ) , u64 > , //IdentityID/ContractID -> nonce
681
686
platform_version : & PlatformVersion ,
682
687
price : Option < Credits > ,
683
- recipient : Option < Identifier >
688
+ recipient : Option < Identifier > ,
684
689
) -> Result < Vec < DocumentTransition > , ProtocolError > {
685
690
documents
686
691
. into_iter ( )
0 commit comments