Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dirname committed May 9, 2021
1 parent 9abbba7 commit 3eaba1a
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ import (
)

func main() {
client := futuresusdt.NewUSDTFuturesCandlestickWebsocketClient("btcusdt@kline_1m")
client := futuresusdt.NewUSDFuturesCandlestickWebsocketClient("btcusdt@kline_1m")
client.SetReadTimerInterval(5 * time.Second)
client.SetReconnectWaitTime(5 * time.Second)
client.SetKeepAliveInterval(2 * time.Minute)
Expand Down
8 changes: 4 additions & 4 deletions futures/usd/client/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCommonClient_GetServerTime(t *testing.T) {
t.Errorf("GetServerTime() error = %v, wantErr %v", err, tt.wantErr)
return
}
if got != tt.want {
if got >= tt.want+5000 {
t.Errorf("GetServerTime() got = %v, want %v", got, tt.want)
}
})
Expand All @@ -48,7 +48,7 @@ func TestCommonClient_Ping(t *testing.T) {
want interface{}
wantErr bool
}{
{"TestCommonClient_Ping", fields{Builder: binance.NewPublicUrlBuilder(config.SpotRestHost)}, nil, false},
{"TestCommonClient_Ping", fields{Builder: binance.NewPublicUrlBuilder(config.USDFuturesRestHost)}, nil, false},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand All @@ -61,7 +61,7 @@ func TestCommonClient_Ping(t *testing.T) {
t.Errorf("Ping() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
if reflect.DeepEqual(got, tt.want) {
t.Errorf("Ping() got = %v, want %v", got, tt.want)
}
})
Expand All @@ -77,7 +77,7 @@ func TestNewCommonClient(t *testing.T) {
args args
want *CommonClient
}{
{"TestNewCommonClient", args{host: config.SpotRestHost}, nil},
{"TestNewCommonClient", args{host: config.USDFuturesRestHost}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/BLVTCandlestickWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesBLVTCandlestickWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesBLVTCandlestickWebsocketClient(t *testing.T) {
func TestNewUSDFuturesBLVTCandlestickWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesBLVTCandlestickWebsocketClient(t *testing.T) {
args args
want *FuturesBLVTCandlestickWebsocketClient
}{
{"TestNewUSDTFuturesBLVTCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesBLVTCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/BLVTInfoWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesBLVTInfoWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesBLVTInfoClient(t *testing.T) {
func TestNewUSDFuturesBLVTInfoClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesBLVTInfoClient(t *testing.T) {
args args
want *FuturesBLVTInfoWebsocketClient
}{
{"TestNewUSDTFuturesBLVTInfoClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesBLVTInfoClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/aggTradeWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAggTradeWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesAggTradeWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAggTradeWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAggTradeWebsocketClient(t *testing.T) {
args args
want *FuturesAggTradeWebsocketClient
}{
{"TestNewUSDTFuturesAggTradeWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAggTradeWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/allBookTickerWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAllBookTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesAllBookTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAllBookTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAllBookTickerWebsocketClient(t *testing.T) {
args args
want *FuturesAllBookTickerWebsocketClient
}{
{"TestNewUSDTFuturesAllBookTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAllBookTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAllMarketLiquidationOrderWebsocketClient_handleMessage(t *testin
}
}

func TestNewUSDTFuturesAllMarketLiquidationOrderWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAllMarketLiquidationOrderWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAllMarketLiquidationOrderWebsocketClient(t *testing.T) {
args args
want *FuturesAllMarketLiquidationOrderWebsocketClient
}{
{"TestNewUSDTFuturesAllMarketLiquidationOrderWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAllMarketLiquidationOrderWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAllMarketMiniTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesAllMarketMiniTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAllMarketMiniTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAllMarketMiniTickerWebsocketClient(t *testing.T) {
args args
want *FuturesAllMarketMiniTickerWebsocketClient
}{
{"TestNewUSDTFuturesAllMarketMiniTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAllMarketMiniTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/allMarketPriceWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAllMarketPriceWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesAllMarketPriceWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAllMarketPriceWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAllMarketPriceWebsocketClient(t *testing.T) {
args args
want *FuturesAllMarketPriceWebsocketClient
}{
{"TestNewUSDTFuturesAllMarketPriceWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAllMarketPriceWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/allMarketTickerWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesAllMarketTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesAllMarketTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesAllMarketTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesAllMarketTickerWebsocketClient(t *testing.T) {
args args
want *FuturesAllMarketTickerWebsocketClient
}{
{"TestNewUSDTFuturesAllMarketTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesAllMarketTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/candlestickWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesCandlestickWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesCandlestickWebsocketClient(t *testing.T) {
func TestNewUSDFuturesCandlestickWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesCandlestickWebsocketClient(t *testing.T) {
args args
want *FuturesCandlestickWebsocketClient
}{
{"TestNewUSDTFuturesCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/compositeIndexWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestFuturesCompositeIndexWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesCompositeIndexWebsocketClient(t *testing.T) {
func TestNewUSDFuturesCompositeIndexWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -228,7 +228,7 @@ func TestNewUSDTFuturesCompositeIndexWebsocketClient(t *testing.T) {
args args
want *FuturesCompositeIndexWebsocketClient
}{
{"TestNewUSDTFuturesCompositeIndexWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesCompositeIndexWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesContinuesCandlestickWebsocketClient_handleMessage(t *testing.T)
}
}

func TestNewUSDTFuturesContinuesCandlestickWebsocketClient(t *testing.T) {
func TestNewUSDFuturesContinuesCandlestickWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesContinuesCandlestickWebsocketClient(t *testing.T) {
args args
want *FuturesContinuesCandlestickWebsocketClient
}{
{"TestNewUSDTFuturesContinuesCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesContinuesCandlestickWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/diffBookDepthWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesDiffBookDepthWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesDiffBookDepthWebsocketClient(t *testing.T) {
func TestNewUSDFuturesDiffBookDepthWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesDiffBookDepthWebsocketClient(t *testing.T) {
args args
want *FuturesDiffBookDepthWebsocketClient
}{
{"TestNewUSDTFuturesDiffBookDepthWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesDiffBookDepthWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesLiquidationOrderWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesLiquidationOrderWebsocketClient(t *testing.T) {
func TestNewUSDFuturesLiquidationOrderWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesLiquidationOrderWebsocketClient(t *testing.T) {
args args
want *FuturesLiquidationOrderWebsocketClient
}{
{"TestNewUSDTFuturesLiquidationOrderWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesLiquidationOrderWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/marketPriceWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesMarketPriceWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesMarketPriceWebsocketClient(t *testing.T) {
func TestNewUSDFuturesMarketPriceWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesMarketPriceWebsocketClient(t *testing.T) {
args args
want *FuturesMarketPriceWebsocketClient
}{
{"TestNewUSDTFuturesMarketPriceWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesMarketPriceWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesPartialBookDepthWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesPartialBookDepthWebsocketClient(t *testing.T) {
func TestNewUSDFuturesPartialBookDepthWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesPartialBookDepthWebsocketClient(t *testing.T) {
args args
want *FuturesPartialBookDepthWebsocketClient
}{
{"TestNewUSDTFuturesPartialBookDepthWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesPartialBookDepthWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesSymbolBookTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesSymbolBookTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesSymbolBookTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesSymbolBookTickerWebsocketClient(t *testing.T) {
args args
want *FuturesSymbolBookTickerWebsocketClient
}{
{"TestNewUSDTFuturesSymbolBookTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesSymbolBookTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesSymbolMiniTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesSymbolMiniTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesSymbolMiniTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesSymbolMiniTickerWebsocketClient(t *testing.T) {
args args
want *FuturesSymbolMiniTickerWebsocketClient
}{
{"TestNewUSDTFuturesSymbolMiniTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesSymbolMiniTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions futures/usd/websocket/market/symbolTickerWebsocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestFuturesSymbolTickerWebsocketClient_handleMessage(t *testing.T) {
}
}

func TestNewUSDTFuturesSymbolTickerWebsocketClient(t *testing.T) {
func TestNewUSDFuturesSymbolTickerWebsocketClient(t *testing.T) {
type args struct {
streams []string
}
Expand All @@ -230,7 +230,7 @@ func TestNewUSDTFuturesSymbolTickerWebsocketClient(t *testing.T) {
args args
want *FuturesSymbolTickerWebsocketClient
}{
{"TestNewUSDTFuturesSymbolTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
{"TestNewUSDFuturesSymbolTickerWebsocketClient", args{streams: []string{"BTCUSDT@markPrice"}}, nil},
// TODO: Add test cases.
}
for _, tt := range tests {
Expand Down

0 comments on commit 3eaba1a

Please sign in to comment.