Skip to content

Commit

Permalink
Cosmetic: Fixing formulation of chain-id verification error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Oct 4, 2024
1 parent ba1e1ff commit 833dc58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,10 @@ func getNetworkInfo(app *App, ctx *sdk.Context, manifest *UpgradeManifest, expec
}

if 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)
return nil, fmt.Errorf("mismatch of Merge Source ChainID: the \"merge_source_chain_id\" value in the 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("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())
return nil, fmt.Errorf("mismatch of Destination ChainID: the \"destination_chain_id\" value in the 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_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("failed to verify sha256: NetworkConfig file \"%v\" hash \"%v\" does not match expected hash \"%v\"", configFilePath, actualHashHex, expectedSha256Hex)
return nil, fmt.Errorf("failed to verify sha256: NetworkConfig file \"%s\" hash \"%s\" does not match expected hash \"%s\"", configFilePath, actualHashHex, *expectedSha256Hex)
}

// Initialize an empty struct to hold the JSON data
Expand Down

0 comments on commit 833dc58

Please sign in to comment.