mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
binance: fix parser parsebytes
This commit is contained in:
parent
eea4c43619
commit
24e465e5b6
|
@ -300,7 +300,7 @@ var parserPool fastjson.ParserPool
|
|||
|
||||
func parseWebSocketEvent(message []byte) (interface{}, error) {
|
||||
parser := parserPool.Get()
|
||||
val, err := parser.Parse(message)
|
||||
val, err := parser.ParseBytes(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -509,8 +509,8 @@ func parseDepthEvent(val *fastjson.Value) (depth *DepthEvent, err error) {
|
|||
Symbol: string(val.GetStringBytes("s")),
|
||||
FirstUpdateID: val.GetInt64("U"),
|
||||
FinalUpdateID: val.GetInt64("u"),
|
||||
Bids: make(types.PriceVolumeSlice, 0, 50),
|
||||
Asks: make(types.PriceVolumeSlice, 0, 50),
|
||||
Bids: make(types.PriceVolumeSlice, 0, 50),
|
||||
Asks: make(types.PriceVolumeSlice, 0, 50),
|
||||
}
|
||||
|
||||
for _, ev := range val.GetArray("b") {
|
||||
|
|
Loading…
Reference in New Issue
Block a user