-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: alchemist-ti <[email protected]> Co-authored-by: StrathCole <[email protected]> Co-authored-by: nghuyenthevinh2000 <[email protected]>
- Loading branch information
1 parent
3802b9a
commit 95b9728
Showing
40 changed files
with
4,303 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package v6 | ||
|
||
import ( | ||
"github.com/classic-terra/core/v2/app/upgrades" | ||
dyncommtypes "github.com/classic-terra/core/v2/x/dyncomm/types" | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
) | ||
|
||
const UpgradeName = "v6" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateV6UpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{ | ||
Added: []string{ | ||
dyncommtypes.StoreKey, | ||
}, | ||
}, | ||
} |
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 @@ | ||
package v6 | ||
|
||
import ( | ||
"github.com/classic-terra/core/v2/app/keepers" | ||
"github.com/classic-terra/core/v2/app/upgrades" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
func CreateV6UpgradeHandler( | ||
mm *module.Manager, | ||
cfg module.Configurator, | ||
_ upgrades.BaseAppParamManager, | ||
_ *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, cfg, fromVM) | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 @@ | ||
package post | ||
|
||
import ( | ||
dyncommkeeper "github.com/classic-terra/core/v2/x/dyncomm/keeper" | ||
dyncommpost "github.com/classic-terra/core/v2/x/dyncomm/post" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// HandlerOptions are the options required for constructing a default SDK AnteHandler. | ||
type HandlerOptions struct { | ||
DyncommKeeper dyncommkeeper.Keeper | ||
} | ||
|
||
// NewAnteHandler returns an AnteHandler that checks and increments sequence | ||
// numbers, checks signatures & account numbers, and deducts fees from the first | ||
// signer. | ||
func NewPostHandler(options HandlerOptions) (sdk.AnteHandler, error) { | ||
return sdk.ChainAnteDecorators( | ||
dyncommpost.NewDyncommPostDecorator(options.DyncommKeeper), | ||
), nil | ||
} |
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,36 @@ | ||
syntax = "proto3"; | ||
package terra.dyncomm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/classic-terra/core/v2/x/dyncomm/types"; | ||
|
||
// Params defines the parameters for the dyncomm module. | ||
message Params { | ||
option (gogoproto.equal) = true; | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
string max_zero = 1 [ | ||
(gogoproto.moretags) = "yaml:\"max_zero\"", | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string slope_base = 2 [ | ||
(gogoproto.moretags) = "yaml:\"slope_base\"", | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string slope_vp_impact = 3 [ | ||
(gogoproto.moretags) = "yaml:\"slope_vp_impact\"", | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string cap = 4 [ | ||
(gogoproto.moretags) = "yaml:\"cap\"", | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
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,22 @@ | ||
syntax = "proto3"; | ||
package terra.dyncomm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "terra/dyncomm/v1beta1/dyncomm.proto"; | ||
|
||
option go_package = "github.com/classic-terra/core/v2/x/dyncomm/types"; | ||
|
||
// GenesisState defines the dyncomm module's genesis state. | ||
message GenesisState { | ||
// params defines all the paramaters of the module. | ||
Params params = 1 [(gogoproto.nullable) = false]; | ||
repeated ValidatorCommissionRate validator_commission_rates = 2 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// MinDynCommission defines a validator - min commission rate | ||
// pair to be enforced by the blockchain | ||
message ValidatorCommissionRate { | ||
string validator_address = 1; | ||
string min_commission_rate = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; | ||
string target_commission_rate = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; | ||
} |
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,41 @@ | ||
syntax = "proto3"; | ||
package terra.dyncomm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "terra/dyncomm/v1beta1/dyncomm.proto"; | ||
|
||
option go_package = "github.com/classic-terra/core/v2/x/dyncomm/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Params queries all parameters. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/terra/dyncomm/v1beta1/params"; | ||
} | ||
|
||
rpc Rate(QueryRateRequest) returns (QueryRateResponse){ | ||
option (google.api.http).get = "/terra/dyncomm/v1beta1/rates/{validator_addr}"; | ||
} | ||
} | ||
|
||
// QueryParamsRequest is the request type for the Query/Params RPC method. | ||
message QueryParamsRequest {} | ||
|
||
// QueryParamsResponse is the response type for the Query/Params RPC method. | ||
message QueryParamsResponse { | ||
// params defines the parameters of the module. | ||
Params params = 1 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// QueryRateRequest is the request type for the Query/Rate RPC method. | ||
message QueryRateRequest { | ||
// validator_addr defines the validator address to query for. | ||
string validator_addr = 1; | ||
} | ||
|
||
// QueryRateResponse is the response type for the Query/Rate RPC method. | ||
message QueryRateResponse { | ||
string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; | ||
string target = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; | ||
} |
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
Oops, something went wrong.