Skip to content
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

chore(x/genutil): cleanup CollectTxs #17816

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
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
8 changes: 5 additions & 3 deletions x/genutil/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx
return appGenTxs, persistentPeers, err
}

var fos []os.DirEntry
fos, err = os.ReadDir(genTxsDir)
fos, err := os.ReadDir(genTxsDir)
if err != nil {
return appGenTxs, persistentPeers, err
}
Expand All @@ -96,6 +95,9 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx
// addresses and IPs (and port) validator server info
var addressesIPs []string

// TODO (https://github.com/cosmos/cosmos-sdk/issues/17815):
// Examine CPU and RAM profiles to see if we can parsing
// and ValidateAndGetGenTx concurrent.
for _, fo := range fos {
if fo.IsDir() {
continue
Expand Down Expand Up @@ -151,7 +153,7 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx
return appGenTxs, persistentPeers, fmt.Errorf("account %s balance not in genesis state: %+v", valAccAddr, balancesMap)
}

_, valOk := balancesMap[sdk.AccAddress(valAddr).String()]
_, valOk := balancesMap[valAccAddr]
odeke-em marked this conversation as resolved.
Show resolved Hide resolved
if !valOk {
_, file, no, ok := runtime.Caller(1)
if ok {
Expand Down
Loading