Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Apr 17, 2024
1 parent d71cbc3 commit b8d5141
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/zetacored/parse_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func ImportDataIntoFile(genDoc *types.GenesisDoc, importFile *types.GenesisDoc,
if Modify[m] {
switch m {
case crosschaintypes.ModuleName:
err := ModifyCrossChainState(appState, importAppState, cdc)
err := ModifyCrosschainState(appState, importAppState, cdc)
if err != nil {
return err
}
Expand All @@ -145,9 +145,9 @@ func ImportDataIntoFile(genDoc *types.GenesisDoc, importFile *types.GenesisDoc,
return nil
}

// ModifyCrossChainState modifies the crosschain state before importing
// ModifyCrosschainState modifies the crosschain state before importing
// It truncates the crosschain transactions, inbound transactions and finalized inbounds to MaxItemsForList
func ModifyCrossChainState(appState map[string]json.RawMessage, importAppState map[string]json.RawMessage, cdc codec.Codec) error {
func ModifyCrosschainState(appState map[string]json.RawMessage, importAppState map[string]json.RawMessage, cdc codec.Codec) error {
importedCrossChainGenState := crosschaintypes.GetGenesisStateFromAppState(cdc, importAppState)
importedCrossChainGenState.CrossChainTxs = importedCrossChainGenState.CrossChainTxs[:math.Min(MaxItemsForList, len(importedCrossChainGenState.CrossChainTxs))]
importedCrossChainGenState.InTxHashToCctxList = importedCrossChainGenState.InTxHashToCctxList[:math.Min(MaxItemsForList, len(importedCrossChainGenState.InTxHashToCctxList))]
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetacored/parse_genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Test_ModifyCrossChainState(t *testing.T) {
cdc := keepertest.NewCodec()
appState := sample.AppState(t)
importData := GetImportData(t, cdc, 100)
err := zetacored.ModifyCrossChainState(appState, importData, cdc)
err := zetacored.ModifyCrosschainState(appState, importData, cdc)
require.NoError(t, err)

modifiedCrosschainAppState := crosschaintypes.GetGenesisStateFromAppState(cdc, appState)
Expand All @@ -52,7 +52,7 @@ func Test_ModifyCrossChainState(t *testing.T) {
cdc := keepertest.NewCodec()
appState := sample.AppState(t)
importData := GetImportData(t, cdc, 8)
err := zetacored.ModifyCrossChainState(appState, importData, cdc)
err := zetacored.ModifyCrosschainState(appState, importData, cdc)
require.NoError(t, err)

modifiedCrosschainAppState := crosschaintypes.GetGenesisStateFromAppState(cdc, appState)
Expand Down

0 comments on commit b8d5141

Please sign in to comment.