Skip to content

Commit

Permalink
refactor: move UpgradeModule interface to appmodule and fix mocks (#…
Browse files Browse the repository at this point in the history
…17383)

Co-authored-by: Marko <[email protected]>
  • Loading branch information
julienrbrt and tac0turtle authored Aug 16, 2023
1 parent 208219a commit e3a3df2
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 127 deletions.
92 changes: 34 additions & 58 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17657,13 +17657,13 @@ paths:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of
the delegator.
delegator_address is the encoded address of the
delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of
the validator.
validator_address is the encoded address of the
validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -18450,12 +18450,12 @@ paths:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator_address is the encoded address of the
delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator_address is the encoded address of the
validator.
entries:
type: array
Expand Down Expand Up @@ -22260,13 +22260,13 @@ paths:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of
the delegator.
delegator_address is the encoded address of the
delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of
the validator.
validator_address is the encoded address of the
validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -22598,12 +22598,12 @@ paths:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator_address is the encoded address of the
delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator_address is the encoded address of the
validator.
shares:
type: string
Expand Down Expand Up @@ -22864,14 +22864,10 @@ paths:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
entries:
type: array
items:
Expand Down Expand Up @@ -23153,12 +23149,12 @@ paths:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator_address is the encoded address of the
delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator_address is the encoded address of the
validator.
entries:
type: array
Expand Down Expand Up @@ -51501,10 +51497,10 @@ definitions:
properties:
delegator_address:
type: string
description: delegator_address is the bech32-encoded address of the delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: validator_address is the bech32-encoded address of the validator.
description: validator_address is the encoded address of the validator.
shares:
type: string
description: shares define the delegation shares received.
Expand All @@ -51520,10 +51516,10 @@ definitions:
properties:
delegator_address:
type: string
description: delegator_address is the bech32-encoded address of the delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: validator_address is the bech32-encoded address of the validator.
description: validator_address is the encoded address of the validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -52022,14 +52018,10 @@ definitions:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -52078,14 +52070,10 @@ definitions:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -52151,14 +52139,10 @@ definitions:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
entries:
type: array
items:
Expand Down Expand Up @@ -53500,10 +53484,10 @@ definitions:
properties:
delegator_address:
type: string
description: delegator_address is the bech32-encoded address of the delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: validator_address is the bech32-encoded address of the validator.
description: validator_address is the encoded address of the validator.
entries:
type: array
items:
Expand Down Expand Up @@ -53560,14 +53544,10 @@ definitions:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
shares:
type: string
description: shares define the delegation shares received.
Expand Down Expand Up @@ -53943,14 +53923,10 @@ definitions:
properties:
delegator_address:
type: string
description: >-
delegator_address is the bech32-encoded address of the
delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: >-
validator_address is the bech32-encoded address of the
validator.
description: validator_address is the encoded address of the validator.
entries:
type: array
items:
Expand Down Expand Up @@ -54627,10 +54603,10 @@ definitions:
properties:
delegator_address:
type: string
description: delegator_address is the bech32-encoded address of the delegator.
description: delegator_address is the encoded address of the delegator.
validator_address:
type: string
description: validator_address is the bech32-encoded address of the validator.
description: validator_address is the encoded address of the validator.
entries:
type: array
items:
Expand Down
4 changes: 4 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v0.10.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.10.0)

* [#17383](https://github.com/cosmos/cosmos-sdk/pull/17383) Add `appmoduke.UpgradeModule` interface.

## [v0.9.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.9.0)

* [#16739](https://github.com/cosmos/cosmos-sdk/pull/16739) Add `AppHash` to header.Info.
Expand Down
7 changes: 7 additions & 0 deletions core/appmodule/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ type HasEndBlocker interface {
// a block.
EndBlock(context.Context) error
}

// UpgradeModule is the extension interface that upgrade module should implement to differentiate
// it from other modules, migration handler need ensure the upgrade module's migration is executed
// before the rest of the modules.
type UpgradeModule interface {
IsUpgradeModule()
}
Loading

0 comments on commit e3a3df2

Please sign in to comment.