mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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) {
|
||||
s.StandardStream.EmitBalanceSnapshot(toGlobalBalanceMap(events))
|
||||
s.StandardStream.EmitBalanceUpdate(toGlobalBalanceMap(events))
|
||||
}
|
||||
|
||||
func (s *Stream) handleOrderEvent(events []OrderEvent) {
|
||||
|
|
|
@ -135,8 +135,8 @@ func TestStream(t *testing.T) {
|
|||
err := s.Connect(context.Background())
|
||||
assert.NoError(t, err)
|
||||
|
||||
s.OnBalanceSnapshot(func(balances types.BalanceMap) {
|
||||
t.Log("got snapshot", balances)
|
||||
s.OnBalanceUpdate(func(balances types.BalanceMap) {
|
||||
t.Log("got update", balances)
|
||||
})
|
||||
c := make(chan struct{})
|
||||
<-c
|
||||
|
|
Loading…
Reference in New Issue
Block a user