File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ pub async fn run_command(args: CastArgs) -> Result<()> {
234234 let event = get_event ( event_sig. as_str ( ) ) ?;
235235 event. decode_log_parts ( core:: iter:: once ( event. selector ( ) ) , & hex:: decode ( data) ?) ?
236236 } else {
237- let data = data . strip_prefix ( "0x" ) . unwrap_or ( data. as_str ( ) ) ;
237+ let data = crate :: strip_0x ( & data) ;
238238 let selector = data. get ( ..64 ) . unwrap_or_default ( ) ;
239239 let selector = selector. parse ( ) ?;
240240 let identified_event =
@@ -254,7 +254,7 @@ pub async fn run_command(args: CastArgs) -> Result<()> {
254254 let error = if let Some ( err_sig) = sig {
255255 get_error ( err_sig. as_str ( ) ) ?
256256 } else {
257- let data = data . strip_prefix ( "0x" ) . unwrap_or ( data. as_str ( ) ) ;
257+ let data = crate :: strip_0x ( & data) ;
258258 let selector = data. get ( ..8 ) . unwrap_or_default ( ) ;
259259 let identified_error =
260260 SignaturesIdentifier :: new ( false ) ?. identify_error ( selector. parse ( ) ?) . await ;
Original file line number Diff line number Diff line change @@ -2401,7 +2401,7 @@ impl SimpleCast {
24012401 }
24022402}
24032403
2404- fn strip_0x ( s : & str ) -> & str {
2404+ pub ( crate ) fn strip_0x ( s : & str ) -> & str {
24052405 s. strip_prefix ( "0x" ) . unwrap_or ( s)
24062406}
24072407
You can’t perform that action at this time.
0 commit comments