Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Dec 6, 2023
1 parent 8128d1a commit 96c267b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions integration/obscurogateway/tengateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ func testGetStorageAtForReturningUserID(t *testing.T, httpURL, wsURL string, w w

// make a request to GetStorageAt with correct parameters to get userID, but with wrong userID
respBody2 := makeHTTPEthJSONReq(httpURL, rpc.GetStorageAt, "invalid_user_id", []interface{}{"getUserID", "0", nil})
if !strings.Contains(string(respBody2), "method eth_getStorageAt cannot be called with an unauthorised client - no signed viewing keys found") {
t.Error("eth_getStorageAt did not respond with error: no signed viewing keys found")
if !strings.Contains(string(respBody2), "encrypyion token ('token') not found in query parameters or user not found in the database") {
t.Error("eth_getStorageAt did not respond with error: encrypyion token ('token') not found in query parameters or user not found in the database")
}

// make a request to GetStorageAt with wrong parameters to get userID, but correct userID
Expand Down Expand Up @@ -219,7 +219,7 @@ func makeRequestHTTP(url string, body []byte) []byte {

func makeHTTPEthJSONReq(url string, method string, userID string, params interface{}) []byte {
reqBody := prepareRequestBody(method, params)
return makeRequestHTTP(fmt.Sprintf("%s/v1/?u=%s", url, userID), reqBody)
return makeRequestHTTP(fmt.Sprintf("%s/v1/?token=%s", url, userID), reqBody)
}

func prepareRequestBody(method string, params interface{}) []byte {
Expand Down
4 changes: 2 additions & 2 deletions tools/walletextension/api/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func ethRequestHandler(walletExt *walletextension.WalletExtension, conn userconn
// Get userID
hexUserID, err := getUserID(conn, 1)
if err != nil || !walletExt.UserExists(hexUserID) {
walletExt.Logger().Info("user not found in the query params: %w.", log.ErrKey, err)
handleEthError(request, conn, walletExt.Logger(), fmt.Errorf("encrypyion token ('token') not found in query parameters"))
walletExt.Logger().Info("user not found in the query params or user not found in the database: %w.", log.ErrKey, err)
handleEthError(request, conn, walletExt.Logger(), fmt.Errorf("encrypyion token ('token') not found in query parameters or user not found in the database"))
}

// todo (@pedro) remove this conn dependency
Expand Down

0 comments on commit 96c267b

Please sign in to comment.