mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 15:11:10 +00:00
ftx: add basic exchange order execution limits for lower bound (#725)
* ftx: add basic exchange order execution limits for lower bound * ftx/binance: conform to standard logger output * ftx: fix field from SizeIncrement -> MinProvideSize * limits: fix whoopsie * limit: add tests * ftx: fix comment
This commit is contained in:
@@ -20,6 +20,22 @@ func TestLoadLimits(t *testing.T) {
|
||||
t.Fatalf("expected error %v but received %v", errCannotLoadLimit, err)
|
||||
}
|
||||
|
||||
invalidAsset := []MinMaxLevel{
|
||||
{
|
||||
Pair: btcusd,
|
||||
MinPrice: 100000,
|
||||
MaxPrice: 1000000,
|
||||
MinAmount: 1,
|
||||
MaxAmount: 10,
|
||||
},
|
||||
}
|
||||
err = e.LoadLimits(invalidAsset)
|
||||
if !errors.Is(err, asset.ErrNotSupported) {
|
||||
t.Fatalf("expected error %v but received %v",
|
||||
asset.ErrNotSupported,
|
||||
err)
|
||||
}
|
||||
|
||||
newLimits := []MinMaxLevel{
|
||||
{
|
||||
Pair: btcusd,
|
||||
@@ -79,6 +95,32 @@ func TestLoadLimits(t *testing.T) {
|
||||
if !errors.Is(err, nil) {
|
||||
t.Fatalf("expected error %v but received %v", nil, err)
|
||||
}
|
||||
|
||||
noCompare := []MinMaxLevel{
|
||||
{
|
||||
Pair: btcusd,
|
||||
Asset: asset.Spot,
|
||||
MinAmount: 10,
|
||||
},
|
||||
}
|
||||
|
||||
err = e.LoadLimits(noCompare)
|
||||
if !errors.Is(err, nil) {
|
||||
t.Fatalf("expected error %v but received %v", nil, err)
|
||||
}
|
||||
|
||||
noCompare = []MinMaxLevel{
|
||||
{
|
||||
Pair: btcusd,
|
||||
Asset: asset.Spot,
|
||||
MinPrice: 10,
|
||||
},
|
||||
}
|
||||
|
||||
err = e.LoadLimits(noCompare)
|
||||
if !errors.Is(err, nil) {
|
||||
t.Fatalf("expected error %v but received %v", nil, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOrderExecutionLimits(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user