-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[R4R] add levels parameter to depth ABCI query #639
Conversation
get it. Go-sdk and http-ap will have change too. |
plugins/dex/client/rest/getdepth.go
Outdated
@@ -13,7 +13,7 @@ import ( | |||
"github.com/binance-chain/node/wire" | |||
) | |||
|
|||
const allowedLimits = "5,10,20,50,100" | |||
const allowedLimits = "5,10,20,50,100,500,1000" // consistent with mainsite: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#market-data-endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comment
done
@@ -13,7 +13,7 @@ import ( | |||
"github.com/binance-chain/node/wire" | |||
) | |||
|
|||
const allowedLimits = "5,10,20,50,100" | |||
const allowedLimits = "5,10,20,50,100,500,1000" // consistent with mainsite: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#market-data-endpoints | |||
const defaultLimit = "100" | |||
|
|||
// DepthReqHandler creates an http request handler to show market depth data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help fix the allowedLimitsA
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help fix the
allowedLimitsA
check
okay okay
plugins/dex/abci.go
Outdated
levelLimit := DefaultDepthLevels | ||
if len(path) == 4 { | ||
levelLimit, err := strconv.Atoi(path[3]) | ||
if err != nil || levelLimit > MaxDepthLevels { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
levelLimit
should be larger than 0.
we should return err
in the Log
if the err
is not nil.
@@ -114,8 +115,9 @@ func showOrderBookCmd(cdc *wire.Codec) *cobra.Command { | |||
if err != nil { | |||
return err | |||
} | |||
levelsLimit := viper.GetInt(flagLevels) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better check levelLimit
here as well.
9300411
to
a3271b9
Compare
Description
add levels parameter to depth ABCI query
@guagualvcha should change http-ap, but this change is compatible with current http-ap if he doesn't :)
WebSocket change: https://github.com/binance-chain/websocket-ap/pull/100
Rationale
websocket needs to snapshot more levels
Example
N/A
Changes
Preflight checks
make build
)make test
)make integration_test
)Already reviewed by
...
Related issues
N/A
Pressure test: @ackratos @zjubfd see the results of depth api using larger limit, https://docs.google.com/spreadsheets/d/147NYJa38FRvXgMnKrUHIfarmg8FYylOmhpCPG9E3MCk/edit?usp=sharing