1- extern crate rustc_hex ;
1+ extern crate hex ;
22extern crate wasmi;
33#[ macro_use]
44extern crate log;
@@ -8,7 +8,6 @@ extern crate ssz;
88extern crate ssz_derive;
99
1010use primitive_types:: U256 ;
11- use rustc_hex:: { FromHex , ToHex } ;
1211use serde:: { Deserialize , Serialize } ;
1312use ssz:: { Decode , Encode } ;
1413use std:: convert:: { TryFrom , TryInto } ;
@@ -35,8 +34,8 @@ impl From<std::io::Error> for ScoutError {
3534 }
3635}
3736
38- impl From < rustc_hex :: FromHexError > for ScoutError {
39- fn from ( error : rustc_hex :: FromHexError ) -> Self {
37+ impl From < hex :: FromHexError > for ScoutError {
38+ fn from ( error : hex :: FromHexError ) -> Self {
4039 ScoutError {
4140 0 : error. description ( ) . to_string ( ) ,
4241 }
@@ -193,7 +192,7 @@ impl<'a> Externals for Runtime<'a> {
193192 let tmp = memory
194193 . get ( ptr, length as usize )
195194 . expect ( "expects reading from memory to succeed" ) ;
196- debug ! ( "deposit: {}" , tmp. to_hex ( ) ) ;
195+ debug ! ( "deposit: {}" , hex :: encode ( tmp. clone ( ) ) ) ;
197196 self . deposits . push ( tmp) ;
198197
199198 Ok ( None )
@@ -231,7 +230,7 @@ impl<'a> Externals for Runtime<'a> {
231230 memory
232231 . get_into ( ptr, & mut buf)
233232 . expect ( "expects reading from memory to succeed" ) ;
234- debug ! ( "print.hex: {}" , buf. to_hex ( ) ) ;
233+ debug ! ( "print.hex: {}" , hex :: encode ( buf) . clone ( ) ) ;
235234 Ok ( None )
236235 }
237236 BIGNUM_ADD256_FUNC => {
@@ -497,7 +496,8 @@ impl Default for BLSPubKey {
497496
498497impl fmt:: Debug for BLSPubKey {
499498 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
500- write ! ( f, "{}" , self . 0 . to_hex( ) )
499+ unimplemented ! ( )
500+ // write!(f, "{}", hex::encode(self.0))
501501 }
502502}
503503
@@ -518,7 +518,8 @@ impl Default for BLSSignature {
518518
519519impl fmt:: Debug for BLSSignature {
520520 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
521- write ! ( f, "{}" , self . 0 . to_hex( ) )
521+ unimplemented ! ( )
522+ // write!(f, "{}", hex::encode(self.0))
522523 }
523524}
524525
@@ -574,7 +575,7 @@ pub struct ShardState {
574575
575576impl fmt:: Display for ShardBlockBody {
576577 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
577- write ! ( f, "{}" , self . data. to_hex ( ) )
578+ write ! ( f, "{}" , hex :: encode ( self . data. clone ( ) ) )
578579 }
579580}
580581
@@ -593,7 +594,7 @@ impl fmt::Display for ShardState {
593594 let states: Vec < String > = self
594595 . exec_env_states
595596 . iter ( )
596- . map ( |x| x . bytes . to_hex ( ) )
597+ . map ( |state| hex :: encode ( state . bytes ) )
597598 . collect ( ) ;
598599 write ! (
599600 f,
@@ -723,7 +724,7 @@ struct TestFile {
723724}
724725
725726fn hex_to_slice ( input : & str , output : & mut [ u8 ] ) -> Result < ( ) , ScoutError > {
726- let tmp = input . from_hex ( ) ?;
727+ let tmp = hex :: decode ( input ) ?;
727728 if tmp. len ( ) != output. len ( ) {
728729 return Err ( ScoutError ( "Length mismatch from hex input" . to_string ( ) ) ) ;
729730 }
@@ -791,7 +792,7 @@ impl TryFrom<TestShardBlock> for ShardBlock {
791792 Ok ( ShardBlock {
792793 env : input. env ,
793794 data : ShardBlockBody {
794- data : input. data . from_hex ( ) ?,
795+ data : hex :: decode ( input. data ) ?,
795796 } ,
796797 } )
797798 }
0 commit comments