Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"io/fs"
"maps"
Comment thread
deepdring marked this conversation as resolved.
"math"
"net/http"
"os"
Expand Down Expand Up @@ -1343,9 +1344,7 @@ func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) {
// GetMaccPerms returns a copy of the module account permissions
func GetMaccPerms() map[string][]string {
dupMaccPerms := make(map[string][]string)
for k, v := range maccPerms {
dupMaccPerms[k] = v
}
maps.Copy(dupMaccPerms, maccPerms)
return dupMaccPerms
}

Expand Down
6 changes: 2 additions & 4 deletions x/cronos/rpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,9 @@ func (api *CronosAPI) ReplayBlock(blockNrOrHash rpctypes.BlockNumberOrHash, post
}

// minus one to get the context of block beginning
contextHeight := blockNumber - 1
if contextHeight < 1 {
contextHeight := max(blockNumber-1,
// 0 is a special value in `ContextWithHeight`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is line should be dropped

contextHeight = 1
}
1)
rsp, err := api.cronosQueryClient.ReplayBlock(rpctypes.ContextWithHeight(contextHeight), req)
Comment thread
deepdring marked this conversation as resolved.
if err != nil {
return nil, err
Expand Down