@@ -103,7 +103,7 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
103103 }
104104 } ) ,
105105 power : 100 ,
106- pro_tx_hash : reverse ( pro_tx_hash. as_byte_array ( ) ) ,
106+ pro_tx_hash : pro_tx_hash. as_byte_array ( ) . to_vec ( ) ,
107107 node_address,
108108 } ) )
109109 }
@@ -135,7 +135,7 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
135135 }
136136 } ) ,
137137 power : 100 ,
138- pro_tx_hash : reverse ( & pro_tx_hash. to_byte_array ( ) ) ,
138+ pro_tx_hash : pro_tx_hash. to_byte_array ( ) . to_vec ( ) ,
139139 node_address,
140140 } ) )
141141 }
@@ -150,7 +150,7 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
150150 threshold_public_key : Some ( crypto:: PublicKey {
151151 sum : Some ( Bls12381 ( self . threshold_public_key . to_bytes ( ) . to_vec ( ) ) ) ,
152152 } ) ,
153- quorum_hash : reverse ( & self . quorum_hash . to_byte_array ( ) ) ,
153+ quorum_hash : self . quorum_hash . to_byte_array ( ) . to_vec ( ) ,
154154 } )
155155 }
156156
@@ -189,15 +189,15 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
189189 sum : Some ( Bls12381 ( public_key. to_bytes ( ) . to_vec ( ) ) ) ,
190190 } ) ,
191191 power : 100 ,
192- pro_tx_hash : reverse ( & pro_tx_hash. to_byte_array ( ) ) ,
192+ pro_tx_hash : pro_tx_hash. to_byte_array ( ) . to_vec ( ) ,
193193 node_address,
194194 } )
195195 } )
196196 . collect ( ) ,
197197 threshold_public_key : Some ( crypto:: PublicKey {
198198 sum : Some ( Bls12381 ( threshold_public_key. to_bytes ( ) . to_vec ( ) ) ) ,
199199 } ) ,
200- quorum_hash : reverse ( & quorum_hash. to_byte_array ( ) ) ,
200+ quorum_hash : quorum_hash. to_byte_array ( ) . to_vec ( ) ,
201201 }
202202 }
203203
@@ -236,15 +236,15 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
236236 sum : Some ( Bls12381 ( public_key. to_bytes ( ) . to_vec ( ) ) ) ,
237237 } ) ,
238238 power : 100 ,
239- pro_tx_hash : reverse ( & pro_tx_hash. to_byte_array ( ) ) ,
239+ pro_tx_hash : pro_tx_hash. to_byte_array ( ) . to_vec ( ) ,
240240 node_address,
241241 } )
242242 } )
243243 . collect ( ) ,
244244 threshold_public_key : Some ( crypto:: PublicKey {
245245 sum : Some ( Bls12381 ( threshold_public_key. to_bytes ( ) . to_vec ( ) ) ) ,
246246 } ) ,
247- quorum_hash : reverse ( & quorum_hash. to_byte_array ( ) ) ,
247+ quorum_hash : quorum_hash. to_byte_array ( ) . to_vec ( ) ,
248248 }
249249 }
250250
@@ -308,13 +308,3 @@ impl ValidatorSetMethodsV0 for ValidatorSetV0 {
308308 } )
309309 }
310310}
311-
312- /// Reverse bytes
313- ///
314- /// TODO: This is a workaround for reversed data returned by dashcore_rpc (little endian / big endian handling issue).
315- /// We need to decide on a consistent approach to endianness and follow it.
316- fn reverse ( data : & [ u8 ] ) -> Vec < u8 > {
317- // data.reverse();
318-
319- data. to_vec ( )
320- }
0 commit comments