@@ -88,7 +88,7 @@ pub mod pallet {
88
88
type RuntimeEvent : From < Event < Self > > + IsType < <Self as frame_system:: Config >:: RuntimeEvent > ;
89
89
90
90
/// Origin for assigning slots.
91
- type AssignSlotOrigin : EnsureOrigin < <Self as frame_system:: Config >:: Origin > ;
91
+ type AssignSlotOrigin : EnsureOrigin < <Self as frame_system:: Config >:: RuntimeOrigin > ;
92
92
93
93
/// The type representing the leasing system.
94
94
type Leaser : Leaser <
@@ -592,7 +592,7 @@ mod tests {
592
592
type BaseCallFilter = frame_support:: traits:: Everything ;
593
593
type BlockWeights = ( ) ;
594
594
type BlockLength = ( ) ;
595
- type Origin = Origin ;
595
+ type RuntimeOrigin = RuntimeOrigin ;
596
596
type RuntimeCall = RuntimeCall ;
597
597
type Index = u64 ;
598
598
type BlockNumber = BlockNumber ;
@@ -738,7 +738,10 @@ mod tests {
738
738
run_to_block ( 1 ) ;
739
739
740
740
assert_noop ! (
741
- AssignedSlots :: assign_perm_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
741
+ AssignedSlots :: assign_perm_parachain_slot(
742
+ RuntimeOrigin :: root( ) ,
743
+ ParaId :: from( 1_u32 ) ,
744
+ ) ,
742
745
Error :: <Test >:: ParaDoesntExist
743
746
) ;
744
747
} ) ;
@@ -750,7 +753,10 @@ mod tests {
750
753
run_to_block ( 1 ) ;
751
754
752
755
assert_noop ! (
753
- AssignedSlots :: assign_perm_parachain_slot( Origin :: signed( 1 ) , ParaId :: from( 1_u32 ) , ) ,
756
+ AssignedSlots :: assign_perm_parachain_slot(
757
+ RuntimeOrigin :: signed( 1 ) ,
758
+ ParaId :: from( 1_u32 ) ,
759
+ ) ,
754
760
BadOrigin
755
761
) ;
756
762
} ) ;
@@ -770,7 +776,10 @@ mod tests {
770
776
assert_ok ! ( TestRegistrar :: <Test >:: make_parachain( ParaId :: from( 1_u32 ) ) ) ;
771
777
772
778
assert_noop ! (
773
- AssignedSlots :: assign_perm_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
779
+ AssignedSlots :: assign_perm_parachain_slot(
780
+ RuntimeOrigin :: root( ) ,
781
+ ParaId :: from( 1_u32 ) ,
782
+ ) ,
774
783
Error :: <Test >:: NotParathread
775
784
) ;
776
785
} ) ;
@@ -792,18 +801,24 @@ mod tests {
792
801
assert_ok ! ( Slots :: lease_out( ParaId :: from( 1_u32 ) , & 1 , 1 , 1 , 1 ) ) ;
793
802
// Try to assign a perm slot in current period fails
794
803
assert_noop ! (
795
- AssignedSlots :: assign_perm_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
804
+ AssignedSlots :: assign_perm_parachain_slot(
805
+ RuntimeOrigin :: root( ) ,
806
+ ParaId :: from( 1_u32 ) ,
807
+ ) ,
796
808
Error :: <Test >:: OngoingLeaseExists
797
809
) ;
798
810
799
811
// Cleanup
800
- assert_ok ! ( Slots :: clear_all_leases( Origin :: root( ) , 1 . into( ) ) ) ;
812
+ assert_ok ! ( Slots :: clear_all_leases( RuntimeOrigin :: root( ) , 1 . into( ) ) ) ;
801
813
802
814
// Register lease for next lease period
803
815
assert_ok ! ( Slots :: lease_out( ParaId :: from( 1_u32 ) , & 1 , 1 , 2 , 1 ) ) ;
804
816
// Should be detected and also fail
805
817
assert_noop ! (
806
- AssignedSlots :: assign_perm_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
818
+ AssignedSlots :: assign_perm_parachain_slot(
819
+ RuntimeOrigin :: root( ) ,
820
+ ParaId :: from( 1_u32 ) ,
821
+ ) ,
807
822
Error :: <Test >:: OngoingLeaseExists
808
823
) ;
809
824
} ) ;
@@ -836,17 +851,20 @@ mod tests {
836
851
) ) ;
837
852
838
853
assert_ok ! ( AssignedSlots :: assign_perm_parachain_slot(
839
- Origin :: root( ) ,
854
+ RuntimeOrigin :: root( ) ,
840
855
ParaId :: from( 1_u32 ) ,
841
856
) ) ;
842
857
assert_ok ! ( AssignedSlots :: assign_perm_parachain_slot(
843
- Origin :: root( ) ,
858
+ RuntimeOrigin :: root( ) ,
844
859
ParaId :: from( 2_u32 ) ,
845
860
) ) ;
846
861
assert_eq ! ( AssignedSlots :: permanent_slot_count( ) , 2 ) ;
847
862
848
863
assert_noop ! (
849
- AssignedSlots :: assign_perm_parachain_slot( Origin :: root( ) , ParaId :: from( 3_u32 ) , ) ,
864
+ AssignedSlots :: assign_perm_parachain_slot(
865
+ RuntimeOrigin :: root( ) ,
866
+ ParaId :: from( 3_u32 ) ,
867
+ ) ,
850
868
Error :: <Test >:: MaxPermanentSlotsExceeded
851
869
) ;
852
870
} ) ;
@@ -868,7 +886,7 @@ mod tests {
868
886
assert_eq ! ( AssignedSlots :: permanent_slots( ParaId :: from( 1_u32 ) ) , None ) ;
869
887
870
888
assert_ok ! ( AssignedSlots :: assign_perm_parachain_slot(
871
- Origin :: root( ) ,
889
+ RuntimeOrigin :: root( ) ,
872
890
ParaId :: from( 1_u32 ) ,
873
891
) ) ;
874
892
@@ -901,7 +919,7 @@ mod tests {
901
919
902
920
assert_noop ! (
903
921
AssignedSlots :: assign_temp_parachain_slot(
904
- Origin :: root( ) ,
922
+ RuntimeOrigin :: root( ) ,
905
923
ParaId :: from( 1_u32 ) ,
906
924
SlotLeasePeriodStart :: Current
907
925
) ,
@@ -917,7 +935,7 @@ mod tests {
917
935
918
936
assert_noop ! (
919
937
AssignedSlots :: assign_temp_parachain_slot(
920
- Origin :: signed( 1 ) ,
938
+ RuntimeOrigin :: signed( 1 ) ,
921
939
ParaId :: from( 1_u32 ) ,
922
940
SlotLeasePeriodStart :: Current
923
941
) ,
@@ -941,7 +959,7 @@ mod tests {
941
959
942
960
assert_noop ! (
943
961
AssignedSlots :: assign_temp_parachain_slot(
944
- Origin :: root( ) ,
962
+ RuntimeOrigin :: root( ) ,
945
963
ParaId :: from( 1_u32 ) ,
946
964
SlotLeasePeriodStart :: Current
947
965
) ,
@@ -967,22 +985,22 @@ mod tests {
967
985
// Try to assign a perm slot in current period fails
968
986
assert_noop ! (
969
987
AssignedSlots :: assign_temp_parachain_slot(
970
- Origin :: root( ) ,
988
+ RuntimeOrigin :: root( ) ,
971
989
ParaId :: from( 1_u32 ) ,
972
990
SlotLeasePeriodStart :: Current
973
991
) ,
974
992
Error :: <Test >:: OngoingLeaseExists
975
993
) ;
976
994
977
995
// Cleanup
978
- assert_ok ! ( Slots :: clear_all_leases( Origin :: root( ) , 1 . into( ) ) ) ;
996
+ assert_ok ! ( Slots :: clear_all_leases( RuntimeOrigin :: root( ) , 1 . into( ) ) ) ;
979
997
980
998
// Register lease for next lease period
981
999
assert_ok ! ( Slots :: lease_out( ParaId :: from( 1_u32 ) , & 1 , 1 , 2 , 1 ) ) ;
982
1000
// Should be detected and also fail
983
1001
assert_noop ! (
984
1002
AssignedSlots :: assign_temp_parachain_slot(
985
- Origin :: root( ) ,
1003
+ RuntimeOrigin :: root( ) ,
986
1004
ParaId :: from( 1_u32 ) ,
987
1005
SlotLeasePeriodStart :: Current
988
1006
) ,
@@ -1006,7 +1024,7 @@ mod tests {
1006
1024
) ) ;
1007
1025
1008
1026
assert_ok ! ( AssignedSlots :: assign_temp_parachain_slot(
1009
- Origin :: root( ) ,
1027
+ RuntimeOrigin :: root( ) ,
1010
1028
ParaId :: from( n as u32 ) ,
1011
1029
SlotLeasePeriodStart :: Current
1012
1030
) ) ;
@@ -1023,7 +1041,7 @@ mod tests {
1023
1041
) ) ;
1024
1042
assert_noop ! (
1025
1043
AssignedSlots :: assign_temp_parachain_slot(
1026
- Origin :: root( ) ,
1044
+ RuntimeOrigin :: root( ) ,
1027
1045
ParaId :: from( 7_u32 ) ,
1028
1046
SlotLeasePeriodStart :: Current
1029
1047
) ,
@@ -1047,7 +1065,7 @@ mod tests {
1047
1065
assert_eq ! ( AssignedSlots :: temporary_slots( ParaId :: from( 1_u32 ) ) , None ) ;
1048
1066
1049
1067
assert_ok ! ( AssignedSlots :: assign_temp_parachain_slot(
1050
- Origin :: root( ) ,
1068
+ RuntimeOrigin :: root( ) ,
1051
1069
ParaId :: from( 1_u32 ) ,
1052
1070
SlotLeasePeriodStart :: Current
1053
1071
) ) ;
@@ -1122,7 +1140,7 @@ mod tests {
1122
1140
) ) ;
1123
1141
1124
1142
assert_ok ! ( AssignedSlots :: assign_temp_parachain_slot(
1125
- Origin :: root( ) ,
1143
+ RuntimeOrigin :: root( ) ,
1126
1144
ParaId :: from( n as u32 ) ,
1127
1145
if ( n % 2 ) . is_zero( ) {
1128
1146
SlotLeasePeriodStart :: Current
@@ -1214,7 +1232,7 @@ mod tests {
1214
1232
run_to_block ( 1 ) ;
1215
1233
1216
1234
assert_noop ! (
1217
- AssignedSlots :: unassign_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
1235
+ AssignedSlots :: unassign_parachain_slot( RuntimeOrigin :: root( ) , ParaId :: from( 1_u32 ) , ) ,
1218
1236
Error :: <Test >:: SlotNotAssigned
1219
1237
) ;
1220
1238
} ) ;
@@ -1226,7 +1244,10 @@ mod tests {
1226
1244
run_to_block ( 1 ) ;
1227
1245
1228
1246
assert_noop ! (
1229
- AssignedSlots :: assign_perm_parachain_slot( Origin :: signed( 1 ) , ParaId :: from( 1_u32 ) , ) ,
1247
+ AssignedSlots :: assign_perm_parachain_slot(
1248
+ RuntimeOrigin :: signed( 1 ) ,
1249
+ ParaId :: from( 1_u32 ) ,
1250
+ ) ,
1230
1251
BadOrigin
1231
1252
) ;
1232
1253
} ) ;
@@ -1245,15 +1266,16 @@ mod tests {
1245
1266
) ) ;
1246
1267
1247
1268
assert_ok ! ( AssignedSlots :: assign_perm_parachain_slot(
1248
- Origin :: root( ) ,
1269
+ RuntimeOrigin :: root( ) ,
1249
1270
ParaId :: from( 1_u32 ) ,
1250
1271
) ) ;
1251
1272
1252
1273
assert_eq ! ( TestRegistrar :: <Test >:: is_parachain( ParaId :: from( 1_u32 ) ) , true ) ;
1253
1274
1254
- assert_ok ! (
1255
- AssignedSlots :: unassign_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , )
1256
- ) ;
1275
+ assert_ok ! ( AssignedSlots :: unassign_parachain_slot(
1276
+ RuntimeOrigin :: root( ) ,
1277
+ ParaId :: from( 1_u32 ) ,
1278
+ ) ) ;
1257
1279
1258
1280
assert_eq ! ( AssignedSlots :: permanent_slot_count( ) , 0 ) ;
1259
1281
assert_eq ! ( AssignedSlots :: has_permanent_slot( ParaId :: from( 1_u32 ) ) , false ) ;
@@ -1276,16 +1298,17 @@ mod tests {
1276
1298
) ) ;
1277
1299
1278
1300
assert_ok ! ( AssignedSlots :: assign_temp_parachain_slot(
1279
- Origin :: root( ) ,
1301
+ RuntimeOrigin :: root( ) ,
1280
1302
ParaId :: from( 1_u32 ) ,
1281
1303
SlotLeasePeriodStart :: Current
1282
1304
) ) ;
1283
1305
1284
1306
assert_eq ! ( TestRegistrar :: <Test >:: is_parachain( ParaId :: from( 1_u32 ) ) , true ) ;
1285
1307
1286
- assert_ok ! (
1287
- AssignedSlots :: unassign_parachain_slot( Origin :: root( ) , ParaId :: from( 1_u32 ) , )
1288
- ) ;
1308
+ assert_ok ! ( AssignedSlots :: unassign_parachain_slot(
1309
+ RuntimeOrigin :: root( ) ,
1310
+ ParaId :: from( 1_u32 ) ,
1311
+ ) ) ;
1289
1312
1290
1313
assert_eq ! ( AssignedSlots :: temporary_slot_count( ) , 0 ) ;
1291
1314
assert_eq ! ( AssignedSlots :: active_temporary_slot_count( ) , 0 ) ;
0 commit comments