Skip to content

Commit

Permalink
feat(oracle-keeper): update proto, remove validtors for genesis state
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Mar 13, 2024
1 parent e012b6c commit 7a228f0
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 784 deletions.
2 changes: 0 additions & 2 deletions proto/exocore/oracle/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package exocore.oracle;
import "gogoproto/gogo.proto";
import "exocore/oracle/params.proto";
import "exocore/oracle/prices.proto";
import "exocore/oracle/validators.proto";
import "exocore/oracle/validator_update_block.proto";
import "exocore/oracle/index_recent_params.proto";
import "exocore/oracle/index_recent_msg.proto";
Expand All @@ -20,7 +19,6 @@ message GenesisState {
repeated Prices pricesList = 2 [(gogoproto.nullable) = false];

//TODO: userDefinedTokenFeeder
Validators validators = 3;
ValidatorUpdateBlock validatorUpdateBlock = 4;
IndexRecentParams indexRecentParams = 5;
IndexRecentMsg indexRecentMsg = 6;
Expand Down
13 changes: 0 additions & 13 deletions proto/exocore/oracle/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "exocore/oracle/params.proto";
import "exocore/oracle/prices.proto";
import "exocore/oracle/validators.proto";
import "exocore/oracle/validator_update_block.proto";
import "exocore/oracle/index_recent_params.proto";
import "exocore/oracle/index_recent_msg.proto";
Expand Down Expand Up @@ -35,12 +34,6 @@ service Query {

}

// Queries a Validators by index.
rpc Validators (QueryGetValidatorsRequest) returns (QueryGetValidatorsResponse) {
option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators";

}

// Queries a ValidatorUpdateBlock by index.
rpc ValidatorUpdateBlock (QueryGetValidatorUpdateBlockRequest) returns (QueryGetValidatorUpdateBlockResponse) {
option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validator_update_block";
Expand Down Expand Up @@ -106,12 +99,6 @@ message QueryAllPricesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetValidatorsRequest {}

message QueryGetValidatorsResponse {
Validators Validators = 1 [(gogoproto.nullable) = false];
}

message QueryGetValidatorUpdateBlockRequest {}

message QueryGetValidatorUpdateBlockResponse {
Expand Down
14 changes: 0 additions & 14 deletions proto/exocore/oracle/validators.proto

This file was deleted.

1 change: 0 additions & 1 deletion x/oracle/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
cmd.AddCommand(CmdQueryParams())
cmd.AddCommand(CmdListPrices())
cmd.AddCommand(CmdShowPrices())
cmd.AddCommand(CmdShowValidators())
cmd.AddCommand(CmdShowValidatorUpdateBlock())
cmd.AddCommand(CmdShowIndexRecentParams())
cmd.AddCommand(CmdShowIndexRecentMsg())
Expand Down
38 changes: 0 additions & 38 deletions x/oracle/client/cli/query_validators.go

This file was deleted.

71 changes: 0 additions & 71 deletions x/oracle/client/cli/query_validators_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions x/oracle/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)
k.SetPrices(ctx, elem)
}
// Set if defined
if genState.Validators != nil {
k.SetValidators(ctx, *genState.Validators)
}
// Set if defined
if genState.ValidatorUpdateBlock != nil {
k.SetValidatorUpdateBlock(ctx, *genState.ValidatorUpdateBlock)
}
Expand Down Expand Up @@ -46,11 +42,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
genesis.Params = k.GetParams(ctx)

genesis.PricesList = k.GetAllPrices(ctx)
// Get all validators
validators, found := k.GetValidators(ctx)
if found {
genesis.Validators = &validators
}
// Get all validatorUpdateBlock
validatorUpdateBlock, found := k.GetValidatorUpdateBlock(ctx)
if found {
Expand Down
4 changes: 0 additions & 4 deletions x/oracle/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ func TestGenesis(t *testing.T) {
TokenId: 1,
},
},
Validators: &types.Validators{
Block: 42,
},
ValidatorUpdateBlock: &types.ValidatorUpdateBlock{},
IndexRecentParams: &types.IndexRecentParams{},
IndexRecentMsg: &types.IndexRecentMsg{},
Expand Down Expand Up @@ -56,7 +53,6 @@ func TestGenesis(t *testing.T) {
nullify.Fill(got)

require.ElementsMatch(t, genesisState.PricesList, got.PricesList)
require.Equal(t, genesisState.Validators, got.Validators)
require.Equal(t, genesisState.ValidatorUpdateBlock, got.ValidatorUpdateBlock)
require.Equal(t, genesisState.IndexRecentParams, got.IndexRecentParams)
require.Equal(t, genesisState.IndexRecentMsg, got.IndexRecentMsg)
Expand Down
33 changes: 0 additions & 33 deletions x/oracle/keeper/validators.go

This file was deleted.

38 changes: 0 additions & 38 deletions x/oracle/keeper/validators_test.go

This file was deleted.

Loading

0 comments on commit 7a228f0

Please sign in to comment.