linter: Enable error checking linter (#766)

* golangci: Enable err checking linter to expose unchecked errors.

* gct: handle errors across the board

* gct: handle errors NOTE: Found bug in FTX (WIP)

* linter: fix issues

* ftx/exchanges: fix bug where error was being returned when setting pair management variables to an already enabled state

* bitmex: fix bug where a dangly supported asset in config danglied up the place.

* linter: fix more linter issues

* linter: fix my terrible spelling.

* currency: fix test

* exchanges: fix tests

* logger: fix test

* exchanges: fix tests

* glorious: nits

* vm: revert rm variable and instigate test
This commit is contained in:
Ryan O'Hara-Reid
2021-08-30 14:06:40 +10:00
committed by GitHub
parent c9ab0b1164
commit 8020e1ec6a
99 changed files with 814 additions and 293 deletions

View File

@@ -686,7 +686,12 @@ func wsAuth(client *websocketClient, data interface{}) error {
return err
}
hashPW := crypto.HexEncodeToString(crypto.GetSHA256([]byte(client.password)))
hash, err := crypto.GetSHA256([]byte(client.password))
if err != nil {
return err
}
hashPW := crypto.HexEncodeToString(hash)
if auth.Username == client.username && auth.Password == hashPW {
client.Authenticated = true
wsResp.Data = WebsocketResponseSuccess

View File

@@ -1779,7 +1779,7 @@ func TestRPCServer_GetTicker_LastUpdatedNanos(t *testing.T) {
// Push a mock-up ticker.
now := time.Now()
ticker.ProcessTicker(&ticker.Price{
err = ticker.ProcessTicker(&ticker.Price{
ExchangeName: testExchange,
Pair: pair,
AssetType: asset.Spot,
@@ -1790,6 +1790,9 @@ func TestRPCServer_GetTicker_LastUpdatedNanos(t *testing.T) {
Low: 169,
Close: 196,
})
if err != nil {
t.Fatal(err)
}
// Prepare a ticker request.
request := &gctrpc.GetTickerRequest{