thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RPC 'pair enable' doesn't pass 'enable' bool flag

TaltaM opened this issue · comments

New Issue

Context

When enabling a pair, the 'enable' bool flag isn't passed on.
(I did regenerate the stubs using buf generate).

$ ./gctcli pair enable --exchange Binance --pairs "VITE-BTC" --asset spot
2021/08/17 12:18:30 rpc error: code = Unknown desc = VITE-BTC currency not enabled

Expected Behavior

As the currency was disabled, I expected to see a success response.

Current Behavior

The RPC call returns currency not enabled, what would be the expected behavior on disabling the currency.

Failure Information (for bugs)

Debugging info confirms that in func enableDisableExchangePair the bool enable is false when calling pair enable

Workaround for enabling currencies is to explicitly provide a flag:

$ ./gctcli pair enable --enable  --exchange Binance --pairs "VITE-BTC" --asset spot
{
 "status": "success"
}

Thanks for reporting this issue, please try applying this patch:

https://gist.github.com/thrasher-/341adbb6270cde3bcd5a488510cdb2a7

Yes, that works!