mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* gct: phase one context awareness pass * exchanges: context propagation pass * common/requester: force context requirement * gctcli/exchanges: linter fix * rpcserver: fix test using dummy rpc server * backtester: fix comments * grpc: add correct cancel and timeout for commands * rpcserver_test: add comment on dummy server * common: deprecated SendHTTPGetRequest * linter: fix * linter: turn on no context check * apichecker: fix context linter issue * binance: use param context * common: remove checks as this gets executed before main * common: change mutex to RW as clients can be used by multiple go routines. * common: remove init and JIT default client. Unexport global variables and add protection. * common: Add comments * bithumb: after dinner mints fix
26 lines
558 B
Go
26 lines
558 B
Go
package simulator
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/bitstamp"
|
|
)
|
|
|
|
func TestSimulate(t *testing.T) {
|
|
b := bitstamp.Bitstamp{}
|
|
b.SetDefaults()
|
|
o, err := b.FetchOrderbook(context.Background(),
|
|
currency.NewPair(currency.BTC, currency.USD), asset.Spot)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
r := o.SimulateOrder(10000000, true)
|
|
t.Log(r.Status)
|
|
r = o.SimulateOrder(2171, false)
|
|
t.Log(r.Status)
|
|
}
|