From b8d51418bf8bd06e46373ace546bd62af7508cf2 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Wed, 17 Apr 2024 12:12:04 -0400 Subject: [PATCH] add more comments --- cmd/zetacored/parse_genesis.go | 6 +++--- cmd/zetacored/parse_genesis_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/zetacored/parse_genesis.go b/cmd/zetacored/parse_genesis.go index b25443460a..b94c5645a1 100644 --- a/cmd/zetacored/parse_genesis.go +++ b/cmd/zetacored/parse_genesis.go @@ -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 } @@ -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))] diff --git a/cmd/zetacored/parse_genesis_test.go b/cmd/zetacored/parse_genesis_test.go index 469b57c0ba..76a9e1247f 100644 --- a/cmd/zetacored/parse_genesis_test.go +++ b/cmd/zetacored/parse_genesis_test.go @@ -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) @@ -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)