Skip to content

Commit

Permalink
Add params migration (#36)
Browse files Browse the repository at this point in the history
* Rework oracle vote rating

Increase missed votes for:
- Submitting a price with to much deviation
- Not providing prices for required denoms

* use authority msgs for oracle params

* Remove reward distribution, rename whitelist

* Rename RewardBand to MaxDeviation

* Use list of strings for required denoms

* Add x/denom migration

* Add authority to scheduler keeper

* move scheduler proposals to msg server

---------

Co-authored-by: codehans <[email protected]>
Co-authored-by: starsquid <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2023
1 parent db53cee commit 34a45e9
Show file tree
Hide file tree
Showing 72 changed files with 5,073 additions and 2,878 deletions.
7 changes: 0 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,3 @@ linters:
linters-settings:
nolintlint:
allow-leading-space: true

issues:
exclude-rules:
- path: x/scheduler/client/cli/tx_hook
text: "SA1019: cli.FlagDescription is deprecated: only used for v1beta1 legacy proposals."
- path: x/scheduler/client/cli/tx_hook
text: "SA1019: cli.FlagProposal is deprecated: only used for v1beta1 legacy proposals."
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/make -f

.PHONY: proto

VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')

Expand Down
10 changes: 3 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ import (

"github.com/Team-Kujira/core/docs"
scheduler "github.com/Team-Kujira/core/x/scheduler"
schedulerclient "github.com/Team-Kujira/core/x/scheduler/client"
schedulerkeeper "github.com/Team-Kujira/core/x/scheduler/keeper"
schedulertypes "github.com/Team-Kujira/core/x/scheduler/types"

Expand All @@ -157,9 +156,6 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
var govProposalHandlers []govclient.ProposalHandler

govProposalHandlers = append(govProposalHandlers,
schedulerclient.CreateHookProposalHandler,
schedulerclient.UpdateHookProposalHandler,
schedulerclient.DeleteHookProposalHandler,
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
Expand Down Expand Up @@ -579,7 +575,7 @@ func New(
app.SchedulerKeeper = schedulerkeeper.NewKeeper(
appCodec,
keys[denomtypes.StoreKey],
app.GetSubspace(schedulertypes.ModuleName),
authority,
)

app.OracleKeeper = oraclekeeper.NewKeeper(
Expand All @@ -592,6 +588,7 @@ func New(
app.SlashingKeeper,
app.StakingKeeper,
distrtypes.ModuleName,
authority,
)

denomKeeper := denomkeeper.NewKeeper(
Expand All @@ -601,6 +598,7 @@ func New(
app.AccountKeeper,
app.BankKeeper.WithMintCoinsRestriction(denomtypes.NewdenomDenomMintCoinsRestriction()),
app.DistrKeeper,
authority,
)

app.DenomKeeper = &denomKeeper
Expand Down Expand Up @@ -651,7 +649,6 @@ func New(
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(schedulertypes.RouterKey, schedulerkeeper.NewSchedulerProposalHandler(app.SchedulerKeeper)).
AddRoute(alliancemoduletypes.RouterKey, alliancemodule.NewAllianceProposalHandler(app.AllianceKeeper))

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
Expand Down Expand Up @@ -973,7 +970,6 @@ func New(
consensusparamtypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,

denomtypes.ModuleName,
schedulertypes.ModuleName,
oracletypes.ModuleName,
Expand Down
178 changes: 111 additions & 67 deletions docs/proto/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
- [kujira/scheduler/genesis.proto](#kujira/scheduler/genesis.proto)
- [GenesisState](#kujira.scheduler.GenesisState)

- [kujira/scheduler/proposal.proto](#kujira/scheduler/proposal.proto)
- [CreateHookProposal](#kujira.scheduler.CreateHookProposal)
- [DeleteHookProposal](#kujira.scheduler.DeleteHookProposal)
- [UpdateHookProposal](#kujira.scheduler.UpdateHookProposal)

- [kujira/scheduler/query.proto](#kujira/scheduler/query.proto)
- [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest)
- [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse)
Expand All @@ -28,6 +23,16 @@

- [Query](#kujira.scheduler.Query)

- [kujira/scheduler/tx.proto](#kujira/scheduler/tx.proto)
- [MsgCreateHook](#kujira.scheduler.MsgCreateHook)
- [MsgCreateHookResponse](#kujira.scheduler.MsgCreateHookResponse)
- [MsgDeleteHook](#kujira.scheduler.MsgDeleteHook)
- [MsgDeleteHookResponse](#kujira.scheduler.MsgDeleteHookResponse)
- [MsgUpdateHook](#kujira.scheduler.MsgUpdateHook)
- [MsgUpdateHookResponse](#kujira.scheduler.MsgUpdateHookResponse)

- [Msg](#kujira.scheduler.Msg)

- [Scalar Value Types](#scalar-value-types)


Expand Down Expand Up @@ -127,170 +132,209 @@



<a name="kujira/scheduler/proposal.proto"></a>
<a name="kujira/scheduler/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## kujira/scheduler/proposal.proto
## kujira/scheduler/query.proto



<a name="kujira.scheduler.CreateHookProposal"></a>
<a name="kujira.scheduler.QueryAllHookRequest"></a>

### CreateHookProposal
### QueryAllHookRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | Title is a short summary |
| `description` | [string](#string) | | Description is a human readable text |
| `executor` | [string](#string) | | The account that will execute the msg on the schedule |
| `contract` | [string](#string) | | The contract that the msg is called on |
| `msg` | [bytes](#bytes) | | |
| `frequency` | [int64](#int64) | | |
| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | |






<a name="kujira.scheduler.DeleteHookProposal"></a>
<a name="kujira.scheduler.QueryAllHookResponse"></a>

### DeleteHookProposal
### QueryAllHookResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | Title is a short summary |
| `description` | [string](#string) | | Description is a human readable text |
| `id` | [uint64](#uint64) | | |
| `Hook` | [Hook](#kujira.scheduler.Hook) | repeated | |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | |






<a name="kujira.scheduler.UpdateHookProposal"></a>
<a name="kujira.scheduler.QueryGetHookRequest"></a>

### UpdateHookProposal
### QueryGetHookRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | Title is a short summary |
| `description` | [string](#string) | | Description is a human readable text |
| `id` | [uint64](#uint64) | | |
| `executor` | [string](#string) | | |
| `contract` | [string](#string) | | |
| `msg` | [bytes](#bytes) | | |
| `frequency` | [int64](#int64) | | |
| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |





<!-- end messages -->

<!-- end enums -->

<a name="kujira.scheduler.QueryGetHookResponse"></a>

<!-- end HasExtensions -->
### QueryGetHookResponse


<!-- end services -->

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `Hook` | [Hook](#kujira.scheduler.Hook) | | |






<a name="kujira/scheduler/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>
<a name="kujira.scheduler.QueryParamsRequest"></a>

### QueryParamsRequest
QueryParamsRequest is request type for the Query/Params RPC method.

## kujira/scheduler/query.proto



<a name="kujira.scheduler.QueryAllHookRequest"></a>

### QueryAllHookRequest

<a name="kujira.scheduler.QueryParamsResponse"></a>

### QueryParamsResponse
QueryParamsResponse is response type for the Query/Params RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | |
| `params` | [Params](#kujira.scheduler.Params) | | params holds all the parameters of this module. |






<a name="kujira.scheduler.QueryAllHookResponse"></a>
<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

### QueryAllHookResponse

<a name="kujira.scheduler.Query"></a>

### Query
Query defines the gRPC querier service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Params` | [QueryParamsRequest](#kujira.scheduler.QueryParamsRequest) | [QueryParamsResponse](#kujira.scheduler.QueryParamsResponse) | Parameters queries the parameters of the module. | GET|/kujira/scheduler/params|
| `Hook` | [QueryGetHookRequest](#kujira.scheduler.QueryGetHookRequest) | [QueryGetHookResponse](#kujira.scheduler.QueryGetHookResponse) | Queries a Hook by id. | GET|/kujira/scheduler/hook/{id}|
| `HookAll` | [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest) | [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse) | Queries a list of Hook items. | GET|/kujira/scheduler/hook|

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `Hook` | [Hook](#kujira.scheduler.Hook) | repeated | |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | |
<!-- end services -->



<a name="kujira/scheduler/tx.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## kujira/scheduler/tx.proto



<a name="kujira.scheduler.QueryGetHookRequest"></a>
<a name="kujira.scheduler.MsgCreateHook"></a>

### QueryGetHookRequest
### MsgCreateHook



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `id` | [uint64](#uint64) | | |
| `authority` | [string](#string) | | |
| `executor` | [string](#string) | | The account that will execute the msg on the schedule |
| `contract` | [string](#string) | | The contract that the msg is called on |
| `msg` | [bytes](#bytes) | | |
| `frequency` | [int64](#int64) | | |
| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="kujira.scheduler.QueryGetHookResponse"></a>
<a name="kujira.scheduler.MsgCreateHookResponse"></a>

### QueryGetHookResponse
### MsgCreateHookResponse







<a name="kujira.scheduler.MsgDeleteHook"></a>

### MsgDeleteHook



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `Hook` | [Hook](#kujira.scheduler.Hook) | | |
| `authority` | [string](#string) | | |
| `id` | [uint64](#uint64) | | |






<a name="kujira.scheduler.QueryParamsRequest"></a>
<a name="kujira.scheduler.MsgDeleteHookResponse"></a>

### QueryParamsRequest
QueryParamsRequest is request type for the Query/Params RPC method.
### MsgDeleteHookResponse







<a name="kujira.scheduler.QueryParamsResponse"></a>
<a name="kujira.scheduler.MsgUpdateHook"></a>

### QueryParamsResponse
QueryParamsResponse is response type for the Query/Params RPC method.
### MsgUpdateHook



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#kujira.scheduler.Params) | | params holds all the parameters of this module. |
| `authority` | [string](#string) | | |
| `id` | [uint64](#uint64) | | |
| `executor` | [string](#string) | | |
| `contract` | [string](#string) | | |
| `msg` | [bytes](#bytes) | | |
| `frequency` | [int64](#int64) | | |
| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |






<a name="kujira.scheduler.MsgUpdateHookResponse"></a>

### MsgUpdateHookResponse





Expand All @@ -302,16 +346,16 @@
<!-- end HasExtensions -->


<a name="kujira.scheduler.Query"></a>
<a name="kujira.scheduler.Msg"></a>

### Query
Query defines the gRPC querier service.
### Msg
Msg defines the scheduler Msg service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Params` | [QueryParamsRequest](#kujira.scheduler.QueryParamsRequest) | [QueryParamsResponse](#kujira.scheduler.QueryParamsResponse) | Parameters queries the parameters of the module. | GET|/kujira/scheduler/params|
| `Hook` | [QueryGetHookRequest](#kujira.scheduler.QueryGetHookRequest) | [QueryGetHookResponse](#kujira.scheduler.QueryGetHookResponse) | Queries a Hook by id. | GET|/kujira/scheduler/hook/{id}|
| `HookAll` | [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest) | [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse) | Queries a list of Hook items. | GET|/kujira/scheduler/hook|
| `CreateHook` | [MsgCreateHook](#kujira.scheduler.MsgCreateHook) | [MsgCreateHookResponse](#kujira.scheduler.MsgCreateHookResponse) | CreateHook adds a new hook to the scheduler | |
| `UpdateHook` | [MsgUpdateHook](#kujira.scheduler.MsgUpdateHook) | [MsgUpdateHookResponse](#kujira.scheduler.MsgUpdateHookResponse) | UpdateHook updates an existing hook | |
| `DeleteHook` | [MsgDeleteHook](#kujira.scheduler.MsgDeleteHook) | [MsgDeleteHookResponse](#kujira.scheduler.MsgDeleteHookResponse) | DeleteHook removes a hook from the scheduler | |

<!-- end services -->

Expand Down
Loading

0 comments on commit 34a45e9

Please sign in to comment.