Skip to content

Commit

Permalink
Cosmetic: Adjusting formul. of log messages related to sha256 verif.
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Oct 4, 2024
1 parent 5e7b031 commit ba1e1ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func New(

app.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// register the governance hooks
),
)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/upgrade_cudos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/upgrade_v_11_4_network_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba1e1ff

Please sign in to comment.