@@ -279,8 +279,7 @@ func processNumericString(s string) *big.Int {
279279 if strings .Contains (s , ":" ) {
280280 log .Fatal ().Str ("string" , s ).Msg ("Unknown number format" )
281281 }
282- if strings .HasPrefix (s , "0x" ) {
283- s = strings .TrimPrefix (s , "0x" )
282+ if s , ok := strings .CutPrefix (s , "0x" ); ok {
284283 num , fullRead := new (big.Int ).SetString (s , 16 )
285284 if ! fullRead {
286285 log .Fatal ().Str ("input" , s ).Msg ("Unable to read the full hex data?!" )
@@ -585,8 +584,7 @@ func rawArgsToStrings(rawArgs string, params []string) []string {
585584 processedArgs := make ([]string , count )
586585 for k , arg := range argList {
587586 if strings .HasPrefix (params [k ], "uint" ) {
588- if strings .HasPrefix (arg , "0x" ) {
589- arg = strings .TrimPrefix (arg , "0x" )
587+ if arg , ok := strings .CutPrefix (arg , "0x" ); ok {
590588 if len (arg ) > 64 {
591589 // i think this is a bug but there is a test case that's somehow longer than 32 bytes
592590 // https://github.com/ethereum/tests/blob/fd26aad70e24f042fcd135b2f0338b1c6bf1a324/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/transStorageOKFiller.yml#L801
0 commit comments