diff --git a/tools/walletextension/httpapi/utils.go b/tools/walletextension/httpapi/utils.go index 80c58ba0cb..c7acc16b8c 100644 --- a/tools/walletextension/httpapi/utils.go +++ b/tools/walletextension/httpapi/utils.go @@ -26,7 +26,7 @@ func getUserID(conn UserConn) ([]byte, error) { userID, err := getQueryParameter(conn.ReadRequestParams(), common.EncryptedTokenQueryParameter) if err == nil { if len(userID) != common.MessageUserIDLenWithPrefix { - return nil, fmt.Errorf(fmt.Sprintf("wrong length of userID from URL. Got: %d, Expected: %d", len(userID), common.MessageUserIDLen)) + return nil, fmt.Errorf(fmt.Sprintf("wrong length of userID from URL. Got: %d, Expected: %d", len(userID), common.MessageUserIDLenWithPrefix)) } return hexutils.HexToBytes(userID[2:]), err } diff --git a/tools/walletextension/lib/client_lib.go b/tools/walletextension/lib/client_lib.go index 3e63a1a22e..72eda7b77c 100644 --- a/tools/walletextension/lib/client_lib.go +++ b/tools/walletextension/lib/client_lib.go @@ -74,7 +74,7 @@ func (o *TGLib) RegisterAccount(pk *ecdsa.PrivateKey, addr gethcommon.Address) e req, err := http.NewRequestWithContext( context.Background(), http.MethodPost, - o.httpURL+"/v1/authenticate/?token="+hexutils.BytesToHex(o.userID), + o.httpURL+"/v1/authenticate/?token=0x"+hexutils.BytesToHex(o.userID), strings.NewReader(payload), ) if err != nil { @@ -124,7 +124,7 @@ func (o *TGLib) RegisterAccountPersonalSign(pk *ecdsa.PrivateKey, addr gethcommo req, err := http.NewRequestWithContext( context.Background(), http.MethodPost, - o.httpURL+"/v1/authenticate/?token="+hexutils.BytesToHex(o.userID), + o.httpURL+"/v1/authenticate/?token=0x"+hexutils.BytesToHex(o.userID), strings.NewReader(payload), ) if err != nil {