-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into aaronc/fix-genesis-supply
- Loading branch information
Showing
26 changed files
with
904 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version = 1 | ||
|
||
test_patterns = [ | ||
"tests/**", | ||
"**_test.go" | ||
] | ||
|
||
exclude_patterns = [ | ||
"third_party/proto/**", | ||
"testutil/**", | ||
"proto/cosmos/**", | ||
"contrib/**" | ||
] | ||
|
||
[[analyzers]] | ||
name = "go" | ||
enabled = true | ||
|
||
[analyzers.meta] | ||
import_paths = ["github.com/cosmos/cosmos-sdk"] |
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
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
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 @@ | ||
package v043 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/x/genutil/types" | ||
v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" | ||
v043gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043" | ||
) | ||
|
||
// Migrate migrates exported state from v0.40 to a v0.43 genesis state. | ||
func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { | ||
// Migrate x/gov. | ||
if appState[v040gov.ModuleName] != nil { | ||
// unmarshal relative source genesis application state | ||
var oldGovState v040gov.GenesisState | ||
clientCtx.JSONMarshaler.MustUnmarshalJSON(appState[v040gov.ModuleName], &oldGovState) | ||
|
||
// delete deprecated x/gov genesis state | ||
delete(appState, v040gov.ModuleName) | ||
|
||
// Migrate relative source genesis application state and marshal it into | ||
// the respective key. | ||
appState[v043gov.ModuleName] = clientCtx.JSONMarshaler.MustMarshalJSON(v043gov.MigrateJSON(&oldGovState)) | ||
} | ||
|
||
return appState | ||
} |
Oops, something went wrong.