Skip to content

Commit

Permalink
fix(x/upgrade): Stop treating inline JSON as a URL (#19706)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 5a733e8)

# Conflicts:
#	x/upgrade/CHANGELOG.md
  • Loading branch information
gibson042 authored and mergify[bot] committed Mar 16, 2024
1 parent 6977c22 commit 43965bc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
19 changes: 19 additions & 0 deletions x/upgrade/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

<<<<<<< HEAD
=======
### Improvements

* [#19672](https://github.com/cosmos/cosmos-sdk/pull/19672) Follow latest `cosmossdk.io/core` `PreBlock` simplification.

### State Machine Breaking

* (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) Upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp.

### API Breaking Changes

* [#19443](https://github.com/cosmos/cosmos-sdk/pull/19443) `NewKeeper` takes an `appmodule.Environment` instead of individual services.

### Bug Fixes

* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL.

>>>>>>> 5a733e81d (fix(x/upgrade): Stop treating inline JSON as a URL (#19706))
## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion x/upgrade/plan/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func ParseInfo(infoStr string, opts ...ParseOption) (*Info, error) {
}

// If it's a url, download it and treat the result as the real info.
if _, err := neturl.Parse(infoStr); err == nil {
if _, err := neturl.ParseRequestURI(infoStr); err == nil {
if err := ValidateURL(infoStr, parseConfig.EnforceChecksum); err != nil {
return nil, err
}
Expand Down
6 changes: 6 additions & 0 deletions x/upgrade/plan/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func (s *InfoTestSuite) TestParseInfo() {
expectedInfo: nil,
expectedInError: []string{"plan info must not be blank"},
},
{
name: "empty JSON",
infoStrMaker: makeInfoStrFuncString("{}"),
expectedInfo: &Info{},
expectedInError: nil,
},
{
name: "json binaries is wrong data type",
infoStrMaker: makeInfoStrFuncString(binariesWrongJSON),
Expand Down

0 comments on commit 43965bc

Please sign in to comment.