From ba1e1ff51054a2092656f88a36358b68bdf13b0d Mon Sep 17 00:00:00 2001 From: Peter Bukva Date: Fri, 4 Oct 2024 17:52:01 +0100 Subject: [PATCH] Cosmetic: Adjusting formul. of log messages related to sha256 verif. --- app/app.go | 6 +++--- app/upgrade_cudos.go | 2 +- app/upgrade_v_11_4_network_config.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index 24b12e14..932307e6 100644 --- a/app/app.go +++ b/app/app.go @@ -378,7 +378,7 @@ func New( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) @@ -739,10 +739,10 @@ func getNetworkInfo(app *App, ctx *sdk.Context, manifest *UpgradeManifest, expec } if networkInfo.MergeSourceChainID != expectedChainIdOfMergeSourceGenesis { - return nil, fmt.Errorf("source file chain id %s and current node chain id %s is different", networkInfo.MergeSourceChainID, expectedChainIdOfMergeSourceGenesis) + return nil, fmt.Errorf("mismatch of the `MergeSourceChainID`: NetworkConfig file contains \"%s\", expected value is chan-id from input merge source genesis json file, which is \"%s\"", networkInfo.MergeSourceChainID, expectedChainIdOfMergeSourceGenesis) } if networkInfo.DestinationChainID != ctx.ChainID() { - return nil, fmt.Errorf("source file chain id %s and current node chain id %s is different", networkInfo.DestinationChainID, ctx.ChainID()) + return nil, fmt.Errorf("mismatch of the `DestinationChainID`: NetworkConfig file contains \"%s\", expected value is chan-id of the current running chain, which is \"%s\"", networkInfo.DestinationChainID, ctx.ChainID()) } manifest.NetworkConfigFileSha256 = app.cudosMigrationConfigSha256 diff --git a/app/upgrade_cudos.go b/app/upgrade_cudos.go index 13761b79..c015e7a6 100644 --- a/app/upgrade_cudos.go +++ b/app/upgrade_cudos.go @@ -154,7 +154,7 @@ func LoadCudosGenesis(app *App, manifest *UpgradeManifest) (*map[string]interfac return nil, nil, fmt.Errorf("failed to generate sha256 out of genesis file %v: %w", app.cudosGenesisPath, err) } if app.cudosGenesisSha256 != actualGenesisSha256Hex { - return nil, nil, fmt.Errorf("sha256 failed to verify: genesis file \"%v\" hash %v does not match expected hash %v", app.cudosGenesisPath, actualGenesisSha256Hex, app.cudosGenesisSha256) + return nil, nil, fmt.Errorf("failed to verify sha256: genesis file \"%v\" hash \"%v\" does not match expected hash \"%v\"", app.cudosGenesisPath, actualGenesisSha256Hex, app.cudosGenesisSha256) } manifest.GenesisFileSha256 = actualGenesisSha256Hex diff --git a/app/upgrade_v_11_4_network_config.go b/app/upgrade_v_11_4_network_config.go index 177da7cb..c72199c1 100644 --- a/app/upgrade_v_11_4_network_config.go +++ b/app/upgrade_v_11_4_network_config.go @@ -293,7 +293,7 @@ func LoadNetworkConfigFromFile(configFilePath string, expectedSha256Hex *string) if isVerified, actualHashHex, err := VerifySha256(byteValue, expectedSha256Hex); err != nil { return nil, err } else if !isVerified { - return nil, fmt.Errorf("provided expected sha256 \"%v\" for NetworkConf file does NOT match actual sha256 hash %v of the file content", expectedSha256Hex, actualHashHex) + return nil, fmt.Errorf("failed to verify sha256: NetworkConfig file \"%v\" hash \"%v\" does not match expected hash \"%v\"", configFilePath, actualHashHex, expectedSha256Hex) } // Initialize an empty struct to hold the JSON data