Skip to content

Commit

Permalink
fix tests and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Apr 2, 2024
1 parent 60cd728 commit 0b53528
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/walletextension/httpapi/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions tools/walletextension/lib/client_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0b53528

Please sign in to comment.