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

@@ -394,6 +394,7 @@ func TestWithdraw(t *testing.T) {
}
withdrawCryptoRequest := withdraw.Request{
Exchange: z.Name,
Crypto: withdraw.CryptoRequest{
Address: core.BitcoinDonationAddress,
FeeAmount: 1,
@@ -448,13 +449,31 @@ func TestGetDepositAddress(t *testing.T) {
t.Skip("skipping authenticated function for mock testing")
}
if z.ValidateAPICredentials() {
_, err := z.GetDepositAddress(context.Background(), currency.BTC, "")
_, err := z.GetDepositAddress(context.Background(), currency.XRP, "", "")
if err != nil {
t.Error("GetDepositAddress() error PLEASE MAKE SURE YOU CREATE DEPOSIT ADDRESSES VIA ZB.COM",
err)
}
} else {
_, err := z.GetDepositAddress(context.Background(), currency.BTC, "")
_, err := z.GetDepositAddress(context.Background(), currency.BTC, "", "")
if err == nil {
t.Error("GetDepositAddress() Expected error")
}
}
}
func TestGetMultiChainDepositAddress(t *testing.T) {
if mockTests {
t.Skip("skipping authenticated function for mock testing")
}
if z.ValidateAPICredentials() {
_, err := z.GetMultiChainDepositAddress(context.Background(), currency.USDT)
if err != nil {
t.Error("GetDepositAddress() error PLEASE MAKE SURE YOU CREATE DEPOSIT ADDRESSES VIA ZB.COM",
err)
}
} else {
_, err := z.GetMultiChainDepositAddress(context.Background(), currency.USDT)
if err == nil {
t.Error("GetDepositAddress() Expected error")
}
@@ -1025,8 +1044,25 @@ func TestUpdateTicker(t *testing.T) {
func TestUpdateTickers(t *testing.T) {
t.Parallel()
err := z.UpdateTickers(context.Background(), asset.Spot)
if err := z.UpdateTickers(context.Background(), asset.Spot); err != nil {
t.Fatal(err)
}
}
func TestGetAvailableTransferChains(t *testing.T) {
t.Parallel()
if !z.ValidateAPICredentials() {
t.Skip("api keys not set")
}
_, err := z.GetAvailableTransferChains(context.Background(), currency.BTC)
if err != nil {
t.Error(err)
}
r, err := z.GetAvailableTransferChains(context.Background(), currency.USDT)
if err != nil {
t.Error(err)
}
if len(r) != 3 {
t.Error("expected 3 results")
}
}