File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -115,15 +115,17 @@ func getAntiAbuseOracleAttestation(args GetAntiAbuseOracleAttestationParams) (*S
115115 return nil , err
116116 }
117117
118- // Pad the start if there's a missing leading zero
119- signature := respBody .Result
120- if len (signature )% 2 == 1 {
121- signature = "0" + signature
118+ // Ensure signature is exactly 130 hex characters (65 bytes for secp256k1 signature)
119+ signature := strings . TrimPrefix ( respBody .Result , "0x" )
120+ if len (signature ) < 130 {
121+ signature = strings . Repeat ( "0" , 130 - len ( signature )) + signature
122122 }
123- signatureBytes , err := hex .DecodeString (strings .TrimPrefix (signature , "0x" ))
123+
124+ signatureBytes , err := hex .DecodeString (signature )
124125 if err != nil {
125126 return nil , err
126127 }
128+
127129 attestation := SenderAttestation {
128130 EthAddress : common .HexToAddress (address ),
129131 Message : message ,
You can’t perform that action at this time.
0 commit comments