@@ -96,13 +96,15 @@ impl Weight {
9696 }
9797
9898 /// Constructs a new [`Weight`] from witness size.
99+ #[ deprecated( since = "TBD" , note = "use `from_wu` instead" ) ]
99100 pub const fn from_witness_data_size ( witness_size : u64 ) -> Self { Weight :: from_wu ( witness_size) }
100101
101102 /// Constructs a new [`Weight`] from non-witness size.
102103 ///
103104 /// # Panics
104105 ///
105106 /// If the conversion from virtual bytes overflows.
107+ #[ deprecated( since = "TBD" , note = "use `from_vb` or `from_vb_unchecked` instead" ) ]
106108 pub const fn from_non_witness_data_size ( non_witness_size : u64 ) -> Self {
107109 Weight :: from_wu ( non_witness_size * Self :: WITNESS_SCALE_FACTOR )
108110 }
@@ -366,6 +368,8 @@ mod tests {
366368 fn from_vb_unchecked_panic ( ) { Weight :: from_vb_unchecked ( u64:: MAX ) ; }
367369
368370 #[ test]
371+ #[ allow( deprecated) ] // tests the deprecated function
372+ #[ allow( deprecated_in_future) ]
369373 fn from_witness_data_size ( ) {
370374 let witness_data_size = 1 ;
371375 let got = Weight :: from_witness_data_size ( witness_data_size) ;
@@ -374,6 +378,8 @@ mod tests {
374378 }
375379
376380 #[ test]
381+ #[ allow( deprecated) ] // tests the deprecated function
382+ #[ allow( deprecated_in_future) ]
377383 fn from_non_witness_data_size ( ) {
378384 let non_witness_data_size = 1 ;
379385 let got = Weight :: from_non_witness_data_size ( non_witness_data_size) ;
0 commit comments