From e8d56643c1f1089a4fd02c4aab3c83548e1d85f3 Mon Sep 17 00:00:00 2001 From: jay tseng Date: Thu, 6 Oct 2022 12:16:14 -0400 Subject: [PATCH] add function comment --- types/module/module.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/module/module.go b/types/module/module.go index 7c2f719196dd..2855208f70a9 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -614,6 +614,7 @@ func DefaultMigrationsOrder(modules []string) []string { return out } +// CreateExportFile creates new file for exporting the module genesus state func CreateExportFile(exportPath string, moduleName string, index int) (*os.File, error) { if err := os.MkdirAll(exportPath, 0o700); err != nil { return nil, fmt.Errorf("failed to create directory: %w", err) @@ -628,6 +629,7 @@ func CreateExportFile(exportPath string, moduleName string, index int) (*os.File return f, nil } +// OpenModuleStateFile opens the genesis state file given the path, module name, and file index func OpenModuleStateFile(importPath string, moduleName string, index int) (*os.File, error) { fp := filepath.Join(importPath, fmt.Sprintf("genesis_%s_%d.bin", moduleName, index)) f, err := os.OpenFile(filepath.Clean(fp), os.O_RDONLY, 0o600)