We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7867ace commit ad5f7a9Copy full SHA for ad5f7a9
x/cronos/rpc/api.go
@@ -279,11 +279,8 @@ func (api *CronosAPI) ReplayBlock(blockNrOrHash rpctypes.BlockNumberOrHash, post
279
}
280
281
// minus one to get the context of block beginning
282
- contextHeight := blockNumber - 1
283
- if contextHeight < 1 {
284
- // 0 is a special value in `ContextWithHeight`
285
- contextHeight = 1
286
- }
+ // 0 is a special value in `ContextWithHeight`
+ contextHeight := max(blockNumber-1, 1)
287
rsp, err := api.cronosQueryClient.ReplayBlock(rpctypes.ContextWithHeight(contextHeight), req)
288
if err != nil {
289
return nil, err
0 commit comments