Skip to content

Commit

Permalink
feat: add params to oracle genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
ironman0x7b2 committed Nov 20, 2024
1 parent b41842a commit 3e17421
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 15 deletions.
4 changes: 3 additions & 1 deletion proto/sentinel/oracle/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package sentinel.oracle.v1;

import "gogoproto/gogo.proto";
import "sentinel/oracle/v1/asset.proto";
import "sentinel/oracle/v1/params.proto";

option go_package = "github.com/sentinel-official/hub/v12/x/oracle/types/v1";
option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message GenesisState {
repeated sentinel.oracle.v1.Asset assets = 1;
repeated sentinel.oracle.v1.Asset assets = 1 [(gogoproto.nullable) = false];
Params params = 2 [(gogoproto.nullable) = false];
}
1 change: 1 addition & 0 deletions x/oracle/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func (k *Keeper) InitGenesis(ctx sdk.Context, state *v1.GenesisState) {
k.SetParams(ctx, state.Params)
}

func (k *Keeper) ExportGenesis(ctx sdk.Context) *v1.GenesisState {
Expand Down
6 changes: 5 additions & 1 deletion x/oracle/types/v1/genesis.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package v1

func NewGenesisState() *GenesisState {
return &GenesisState{}
return &GenesisState{
Params: Params{
BlockInterval: 50,
},
}
}

func DefaultGenesisState() *GenesisState {
Expand Down
74 changes: 61 additions & 13 deletions x/oracle/types/v1/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e17421

Please sign in to comment.