-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set upgrade handler for v2-Daisy (#250)
* Set the upgrade handler for v2-Daisy * Update CHANGELOG.md * Check upgrade name * Add the test into CI
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# get module version from go.mod | ||
module_version=$(grep -E '^module github\.com/Finschia/finschia/v.*$' go.mod | cut -d / -f 4) | ||
if [ -z "$module_version" ] | ||
then | ||
echo module version not found: you must update the script >&2 | ||
false | ||
fi | ||
|
||
# get upgrade version from the upgrade name | ||
upgrade_name=$(sed -nE -e 's/^(const)?[[:blank:]]+upgradeName[[:blank:]]+=[[:blank:]]+"([[:digit:][:alpha:]-]+)"$/\2/p' app/app.go) | ||
upgrade_version=$(printf $upgrade_name | cut -d - -f 1) | ||
if [ -z "$upgrade_version" ] | ||
then | ||
echo upgrade version not found: you must update the script >&2 | ||
false | ||
fi | ||
|
||
if [ $upgrade_version != $module_version ] | ||
then | ||
echo different upgrade version found: you must update the upgrade name >&2 | ||
echo wanted: $module_version-Xxx, got: $upgrade_name | ||
false | ||
fi |