-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core)!: clean-up core and simplify preblock #19672
Changes from all commits
3975577
e652da9
7766454
8723606
b4a4bd3
f2ef59a
f346ead
f5246df
24679de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -54,10 +54,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||||||
* Add `MsgHandler` as an alternative to grpc handlers | ||||||||
* Provide separate `MigrationRegistrar` instead of grouping with `RegisterServices` | ||||||||
|
||||||||
### Improvements | ||||||||
|
||||||||
### API Breaking Changes | ||||||||
|
||||||||
* [#19672](https://github.com/cosmos/cosmos-sdk/pull/19672) `PreBlock` now returns only an error for consistency with server/v2. The SDK has upgraded x/upgrade accordingly. | ||||||||
* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` to `x/tx`. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The URL for PR #18861 contains a typo: - * [#18861](httpes://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`.
+ * [#18861](https://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`. Committable suggestion
Suggested change
|
||||||||
* [#18861](httpes://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`. | ||||||||
* [#18866](https://github.com/cosmos/cosmos-sdk/pull/18866) All items related to depinject have been moved to `cosmossdk.io/depinject` (`Provide`, `Invoke`, `Register`) | ||||||||
Comment on lines
54
to
62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There's a missing space after the period in the entry for PR #18457. This is a minor formatting issue but important for readability. - * [#18457](https://github.com/cosmos/cosmos-sdk/pull/18457) Add branch.ExecuteWithGasLimit.
+ * [#18457](https://github.com/cosmos/cosmos-sdk/pull/18457) Add branch.ExecuteWithGasLimit. |
||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package appmodule | ||
|
||
import "context" | ||
import ( | ||
"cosmossdk.io/core/appmodule/v2" | ||
) | ||
|
||
type MigrationRegistrar interface { | ||
// Register registers an in-place store migration for a module. The | ||
// handler is a migration script to perform in-place migrations from version | ||
// `fromVersion` to version `fromVersion+1`. | ||
// | ||
// EACH TIME a module's ConsensusVersion increments, a new migration MUST | ||
// be registered using this function. If a migration handler is missing for | ||
// a particular function, the upgrade logic (see RunMigrations function) | ||
// will panic. If the ConsensusVersion bump does not introduce any store | ||
// changes, then a no-op function must be registered here. | ||
Register(moduleName string, fromVersion uint64, handler func(context.Context) error) error | ||
} | ||
// HasConsensusVersion is the interface for declaring a module consensus version. | ||
type HasConsensusVersion = appmodule.HasConsensusVersion | ||
|
||
// HasMigrations is implemented by a module which upgrades or has upgraded to a new consensus version. | ||
type HasMigrations = appmodule.HasMigrations | ||
|
||
// MigrationRegistrar is the interface for registering in-place store migrations. | ||
type MigrationRegistrar = appmodule.MigrationRegistrar | ||
|
||
// MigrationHandler is the migration function that each module registers. | ||
type MigrationHandler = appmodule.MigrationHandler |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,9 @@ func (a *autocliConfigurator) RegisterMigration(string, uint64, module.Migration | |
return nil | ||
} | ||
|
||
func (a *autocliConfigurator) Register(string, uint64, func(context.Context) error) error { return nil } | ||
func (a *autocliConfigurator) Register(string, uint64, appmodule.MigrationHandler) error { | ||
return nil | ||
} | ||
Comment on lines
+116
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating the |
||
|
||
func (a *autocliConfigurator) RegisterService(sd *grpc.ServiceDesc, ss interface{}) { | ||
if a.registryCache == nil { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this being removed 👍