exchanges/engine: Add multichain deposit/withdrawal support (#794)

* Add exchange multichain support

* Start tidying up

* Add multichain transfer support for Bitfinex and fix poloniex bug

* Add Coinbene multichain support

* Start adjusting the deposit address manager

* Fix deposit tests and further enhancements

* Cleanup

* Add bypass flag, expand tests plus error coverage for Huobi

Adjust helpers

* Address nitterinos

* BFX wd changes

* Address nitterinos

* Minor fixes rebasing on master

* Fix BFX acceptableMethods test

* Add some TO-DOs for 2 tests WRT races

* Fix acceptableMethods test round 2

* Address nitterinos
This commit is contained in:
Adrian Gallagher
2021-10-15 15:55:38 +11:00
committed by GitHub
parent b093a7df19
commit 0c00b7e1df
145 changed files with 46329 additions and 5507 deletions

View File

@@ -1,4 +1,5 @@
//+build mock_test_off
//go:build mock_test_off
// +build mock_test_off
// This will build if build tag mock_test_off is parsed and will do live testing
// using all tests in (exchange)_test.go
@@ -35,9 +36,9 @@ func TestMain(m *testing.M) {
if err != nil {
log.Fatal("Gemini setup error", err)
}
err = g.API.Endpoints.SetRunning(exchange.RestSpot.String(), geminiSandboxAPIURL)
err = g.API.Endpoints.SetRunning(exchange.RestSpot.String(), geminiAPIURL)
if err != nil {
log.Fatalf("endpoint setting failed. key: %s, val: %s", exchange.RestSpot.String(), geminiSandboxAPIURL)
log.Fatalf("endpoint setting failed. key: %s, val: %s", exchange.RestSpot.String(), geminiAPIURL)
}
log.Printf(sharedtestvalues.LiveTesting, g.Name)
os.Exit(m.Run())

View File

@@ -23,8 +23,6 @@ import (
const (
apiKey = ""
apiSecret = ""
apiKeyRole = ""
sessionHeartBeat = false
canManipulateRealOrders = false
)
@@ -487,6 +485,7 @@ func TestModifyOrder(t *testing.T) {
func TestWithdraw(t *testing.T) {
t.Parallel()
withdrawCryptoRequest := withdraw.Request{
Exchange: g.Name,
Amount: -1,
Currency: currency.BTC,
Description: "WITHDRAW IT ALL",
@@ -545,7 +544,7 @@ func TestWithdrawInternationalBank(t *testing.T) {
func TestGetDepositAddress(t *testing.T) {
t.Parallel()
_, err := g.GetDepositAddress(context.Background(), currency.BTC, "")
_, err := g.GetDepositAddress(context.Background(), currency.BTC, "", "")
if err == nil {
t.Error("GetDepositAddress error cannot be nil")
}

View File

@@ -17,6 +17,7 @@ import (
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
"github.com/thrasher-corp/gocryptotrader/exchanges/account"
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
"github.com/thrasher-corp/gocryptotrader/exchanges/deposit"
"github.com/thrasher-corp/gocryptotrader/exchanges/kline"
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
"github.com/thrasher-corp/gocryptotrader/exchanges/orderbook"
@@ -610,12 +611,12 @@ func (g *Gemini) GetOrderInfo(ctx context.Context, orderID string, pair currency
}
// GetDepositAddress returns a deposit address for a specified currency
func (g *Gemini) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _ string) (string, error) {
func (g *Gemini) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error) {
addr, err := g.GetCryptoDepositAddress(ctx, "", cryptocurrency.String())
if err != nil {
return "", err
return nil, err
}
return addr.Address, nil
return &deposit.Address{Address: addr.Address}, nil
}
// WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is