@@ -32,12 +32,12 @@ pub(crate) fn get_is_plutus_data_instance(input: DeriveInput) -> Result<ItemImpl
32
32
let ( impl_generics, type_generics, where_clause) = generics. split_for_impl ( ) ;
33
33
34
34
Ok ( parse_quote ! (
35
- impl #impl_generics plutus_data:: IsPlutusData for #type_name #type_generics #where_clause {
36
- fn to_plutus_data( & self ) -> plutus_data:: PlutusData {
35
+ impl #impl_generics plutus_ledger_api :: plutus_data:: IsPlutusData for #type_name #type_generics #where_clause {
36
+ fn to_plutus_data( & self ) -> plutus_ledger_api :: plutus_data:: PlutusData {
37
37
#encoder
38
38
}
39
39
40
- fn from_plutus_data( plutus_data: & plutus_data:: PlutusData ) -> Result <Self , plutus_data:: PlutusDataError >
40
+ fn from_plutus_data( plutus_data: & plutus_ledger_api :: plutus_data:: PlutusData ) -> Result <Self , plutus_ledger_api :: plutus_data:: PlutusDataError >
41
41
where Self : Sized {
42
42
#decoder
43
43
}
@@ -170,15 +170,15 @@ fn get_newtype_encoder_decoder(input: &DeriveInput) -> Result<(Block, Block)> {
170
170
Some ( field_name) => {
171
171
parse_quote ! ( {
172
172
Ok ( Self {
173
- #field_name: plutus_data:: IsPlutusData :: from_plutus_data( plutus_data) ?
173
+ #field_name: plutus_ledger_api :: plutus_data:: IsPlutusData :: from_plutus_data( plutus_data) ?
174
174
} )
175
175
} )
176
176
}
177
177
None => {
178
178
parse_quote ! ( {
179
- Ok ( Self ( plutus_data :: IsPlutusData :: from_plutus_data (
180
- plutus_data,
181
- ) ? ) )
179
+ Ok ( Self (
180
+ plutus_ledger_api :: plutus_data:: IsPlutusData :: from_plutus_data ( plutus_data ) ? ,
181
+ ) )
182
182
} )
183
183
}
184
184
} ;
@@ -310,11 +310,11 @@ fn enum_from_plutus_data_constr(e: &DataEnum, plutus_data_input_var: &Ident) ->
310
310
311
311
parse_quote ! (
312
312
{
313
- let ( tag, #plutus_data_list_var) = plutus_data :: is_plutus_data :: aux :: parse_constr( #plutus_data_input_var) ?;
313
+ let ( tag, #plutus_data_list_var) = plutus_ledger_api :: plutus_data :: parse_constr( #plutus_data_input_var) ?;
314
314
315
315
match tag {
316
316
#( #arms) , *
317
- tag => Err ( plutus_data:: PlutusDataError :: UnexpectedPlutusInvariant {
317
+ tag => Err ( plutus_ledger_api :: plutus_data:: PlutusDataError :: UnexpectedPlutusInvariant {
318
318
wanted: format!( #expected_tags_str) ,
319
319
got: tag. to_string( ) ,
320
320
} ) ,
@@ -380,7 +380,7 @@ fn variant_with_named_fields_to_plutus_data(
380
380
let plutus_data_list = data_fields_to_list_of_plutus_data ( & field_accessors) ;
381
381
382
382
parse_quote ! (
383
- #constructor{ #( #field_names) , * } => plutus_data:: PlutusData :: Constr ( #tag. into( ) , #plutus_data_list)
383
+ #constructor{ #( #field_names) , * } => plutus_ledger_api :: plutus_data:: PlutusData :: Constr ( #tag. into( ) , #plutus_data_list)
384
384
)
385
385
}
386
386
@@ -407,7 +407,7 @@ fn variant_with_unnamed_field_to_plutus_data(
407
407
let plutus_data_list = data_fields_to_list_of_plutus_data ( & field_accessors) ;
408
408
409
409
parse_quote ! (
410
- #constructor( #( #field_names) , * ) => plutus_data:: PlutusData :: Constr ( #tag. into( ) , #plutus_data_list)
410
+ #constructor( #( #field_names) , * ) => plutus_ledger_api :: plutus_data:: PlutusData :: Constr ( #tag. into( ) , #plutus_data_list)
411
411
)
412
412
}
413
413
@@ -425,7 +425,7 @@ fn variant_with_unnamed_fields_from_plutus_data_list(
425
425
426
426
fn variant_with_no_field_to_plutus_data ( constructor : & Path , tag : usize ) -> Arm {
427
427
parse_quote ! (
428
- #constructor => plutus_data:: PlutusData :: Constr ( #tag. into( ) , vec![ ] )
428
+ #constructor => plutus_ledger_api :: plutus_data:: PlutusData :: Constr ( #tag. into( ) , vec![ ] )
429
429
)
430
430
}
431
431
@@ -463,7 +463,7 @@ fn struct_with_named_fields_to_plutus_data_list(fields: &FieldsNamed) -> Block {
463
463
let to_list_of_plutus_data = struct_with_named_fields_to_list_of_plutus_data ( fields) ;
464
464
465
465
parse_quote ! ( {
466
- plutus_data:: PlutusData :: List ( #to_list_of_plutus_data)
466
+ plutus_ledger_api :: plutus_data:: PlutusData :: List ( #to_list_of_plutus_data)
467
467
} )
468
468
}
469
469
@@ -477,7 +477,7 @@ fn struct_with_named_fields_from_plutus_data_list(
477
477
struct_with_named_fields_from_list_of_plutus_data ( fields, & list_of_plutus_data_var) ;
478
478
479
479
parse_quote ! ( {
480
- let #list_of_plutus_data_var = plutus_data :: is_plutus_data :: aux :: parse_list( #plutus_data_input_var) ?;
480
+ let #list_of_plutus_data_var = plutus_ledger_api :: plutus_data :: parse_list( #plutus_data_input_var) ?;
481
481
482
482
#from_list_of_plutus_data
483
483
} )
@@ -487,7 +487,7 @@ fn struct_with_named_fields_to_plutus_data_constr(fields: &FieldsNamed) -> Block
487
487
let to_list_of_plutus_data = struct_with_named_fields_to_list_of_plutus_data ( fields) ;
488
488
489
489
parse_quote ! ( {
490
- plutus_data:: PlutusData :: Constr ( 0 . into( ) , #to_list_of_plutus_data)
490
+ plutus_ledger_api :: plutus_data:: PlutusData :: Constr ( 0 . into( ) , #to_list_of_plutus_data)
491
491
} )
492
492
}
493
493
@@ -501,7 +501,7 @@ fn struct_with_named_fields_from_plutus_data_constr(
501
501
struct_with_named_fields_from_list_of_plutus_data ( fields, & plutus_data_list_var) ;
502
502
503
503
parse_quote ! ( {
504
- let #plutus_data_list_var = plutus_data :: is_plutus_data :: aux :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
504
+ let #plutus_data_list_var = plutus_ledger_api :: plutus_data :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
505
505
506
506
#from_plutus_data_list
507
507
} )
@@ -537,7 +537,7 @@ fn struct_with_unnamed_fields_to_plutus_data_list(fields: &FieldsUnnamed) -> Blo
537
537
let to_list_of_plutus_data = struct_with_unnamed_fields_to_list_of_plutus_data ( fields) ;
538
538
539
539
parse_quote ! ( {
540
- plutus_data:: PlutusData :: List ( #to_list_of_plutus_data)
540
+ plutus_ledger_api :: plutus_data:: PlutusData :: List ( #to_list_of_plutus_data)
541
541
} )
542
542
}
543
543
@@ -551,7 +551,7 @@ fn struct_with_unnamed_fields_from_plutus_data_list(
551
551
struct_with_unnamed_fields_from_list_of_plutus_data ( fields, & list_of_plutus_data_var) ;
552
552
553
553
parse_quote ! ( {
554
- let #list_of_plutus_data_var = plutus_data :: is_plutus_data :: aux :: parse_list( #plutus_data_input_var) ?;
554
+ let #list_of_plutus_data_var = plutus_ledger_api :: plutus_data :: parse_list( #plutus_data_input_var) ?;
555
555
556
556
#from_list_of_plutus_data
557
557
} )
@@ -561,7 +561,7 @@ fn struct_with_unnamed_fields_to_plutus_data_constr(fields: &FieldsUnnamed) -> B
561
561
let to_list_of_plutus_data = struct_with_unnamed_fields_to_list_of_plutus_data ( fields) ;
562
562
563
563
parse_quote ! ( {
564
- plutus_data:: PlutusData :: Constr ( 0 . into( ) , #to_list_of_plutus_data)
564
+ plutus_ledger_api :: plutus_data:: PlutusData :: Constr ( 0 . into( ) , #to_list_of_plutus_data)
565
565
} )
566
566
}
567
567
@@ -574,7 +574,7 @@ fn struct_with_unnamed_fields_from_plutus_data_constr(
574
574
let from_fields = struct_with_unnamed_fields_from_list_of_plutus_data ( fields, & fields_var) ;
575
575
576
576
parse_quote ! ( {
577
- let #fields_var = plutus_data :: is_plutus_data :: aux :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
577
+ let #fields_var = plutus_ledger_api :: plutus_data :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
578
578
579
579
#from_fields
580
580
} )
@@ -591,7 +591,7 @@ fn struct_with_no_field_from_plutus_data_list(plutus_data_input_var: &Ident) ->
591
591
data_with_no_fields_from_list_of_plutus_data ( & parse_quote ! ( Self ) , & list_of_plutus_data_var) ;
592
592
593
593
parse_quote ! ( {
594
- let #list_of_plutus_data_var = plutus_data :: is_plutus_data :: aux :: parse_list( #plutus_data_input_var) ?;
594
+ let #list_of_plutus_data_var = plutus_ledger_api :: plutus_data :: parse_list( #plutus_data_input_var) ?;
595
595
596
596
#from_list_of_plutus_data
597
597
} )
@@ -608,7 +608,7 @@ fn struct_with_no_field_from_plutus_data_constr(plutus_data_input_var: &Ident) -
608
608
data_with_no_fields_from_list_of_plutus_data ( & parse_quote ! ( Self ) , & fields_var) ;
609
609
610
610
parse_quote ! ( {
611
- let #fields_var = plutus_data :: is_plutus_data :: aux :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
611
+ let #fields_var = plutus_ledger_api :: plutus_data :: parse_constr_with_tag( #plutus_data_input_var, 0 ) ?;
612
612
613
613
#from_fields
614
614
} )
@@ -641,14 +641,14 @@ fn data_with_named_fields_from_list_of_plutus_data(
641
641
let field_decoded_stmts = field_idents. clone ( ) . zip ( unparsed_field_idents. clone ( ) ) . map (
642
642
|( field_ident, unparsed_field_ident) | -> Stmt {
643
643
parse_quote ! (
644
- let #field_ident = plutus_data:: IsPlutusData :: from_plutus_data( #unparsed_field_ident) ?;
644
+ let #field_ident = plutus_ledger_api :: plutus_data:: IsPlutusData :: from_plutus_data( #unparsed_field_ident) ?;
645
645
)
646
646
} ,
647
647
) ;
648
648
649
649
parse_quote ! (
650
650
{
651
- let [ #( #unparsed_field_idents) , * ] = plutus_data :: is_plutus_data :: aux :: parse_fixed_len_constr_fields:: <#field_count>( #plutus_data_list_var) ?;
651
+ let [ #( #unparsed_field_idents) , * ] = plutus_ledger_api :: plutus_data :: parse_fixed_len_constr_fields:: <#field_count>( #plutus_data_list_var) ?;
652
652
#( #field_decoded_stmts) *
653
653
Ok ( #constructor{ #( #field_idents) , * } )
654
654
}
@@ -678,7 +678,7 @@ fn data_with_unnamed_fields_from_list_of_plutus_data(
678
678
} ) ;
679
679
680
680
parse_quote ! ( {
681
- let [ #( #unparsed_field_idents) , * ] = plutus_data :: is_plutus_data :: aux :: parse_fixed_len_constr_fields:: <#field_count>( #plutus_data_list_var) ?;
681
+ let [ #( #unparsed_field_idents) , * ] = plutus_ledger_api :: plutus_data :: parse_fixed_len_constr_fields:: <#field_count>( #plutus_data_list_var) ?;
682
682
#( #field_decoded_stmts) *
683
683
Ok ( #constructor( #( #parsed_field_idents) , * ) )
684
684
} )
@@ -689,7 +689,7 @@ fn data_with_no_fields_from_list_of_plutus_data(
689
689
list_of_plutus_data_var : & Ident ,
690
690
) -> Block {
691
691
parse_quote ! ( {
692
- let [ ] = plutus_data :: is_plutus_data :: aux :: parse_fixed_len_constr_fields:: <0 >( #list_of_plutus_data_var) ?;
692
+ let [ ] = plutus_ledger_api :: plutus_data :: parse_fixed_len_constr_fields:: <0 >( #list_of_plutus_data_var) ?;
693
693
Ok ( #constructor)
694
694
} )
695
695
}
0 commit comments