mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
pkg/exchange: use balance update instead of snapshot event
This commit is contained in:
parent
70884538bc
commit
9f83165032
|
@ -385,7 +385,7 @@ func (s *Stream) handleMarketTradeEvent(events []MarketTradeEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stream) handleWalletEvent(events []bybitapi.WalletBalances) {
|
func (s *Stream) handleWalletEvent(events []bybitapi.WalletBalances) {
|
||||||
s.StandardStream.EmitBalanceSnapshot(toGlobalBalanceMap(events))
|
s.StandardStream.EmitBalanceUpdate(toGlobalBalanceMap(events))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stream) handleOrderEvent(events []OrderEvent) {
|
func (s *Stream) handleOrderEvent(events []OrderEvent) {
|
||||||
|
|
|
@ -135,8 +135,8 @@ func TestStream(t *testing.T) {
|
||||||
err := s.Connect(context.Background())
|
err := s.Connect(context.Background())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
s.OnBalanceSnapshot(func(balances types.BalanceMap) {
|
s.OnBalanceUpdate(func(balances types.BalanceMap) {
|
||||||
t.Log("got snapshot", balances)
|
t.Log("got update", balances)
|
||||||
})
|
})
|
||||||
c := make(chan struct{})
|
c := make(chan struct{})
|
||||||
<-c
|
<-c
|
||||||
|
|
Loading…
Reference in New Issue
Block a user