Skip to content

Commit

Permalink
Avkr003/validate (#963)
Browse files Browse the repository at this point in the history
* change discount values

* more changes

* get discount in amm:

* ifx tests

* fix tests

* fix

* tradeshield fix

* use tier structure

* update tests

* fixing tier keeper pointers (#958)

* fixing tier keeper pointers

* fixing tier keeper pointers

* fixing tier keeper pointers

* fix

* fix

* add discoumt to perpetual

* fix tests

* review changes

* use silver

* adding validation for messages and params

* merging discount branch

* fixing test cases

* fixing test cases

* reverting back vesting tx cmd

* fixing test case

* increasing test coverage

* adding test cases

* Enforce stricter validation on TakeProfitPriceRatios

Added checks to ensure MaximumLongTakeProfitPriceRatio is greater than 1 and greater than MinimumLongTakeProfitPriceRatio, while MinimumLongTakeProfitPriceRatio must also be greater than 1. Additionally, imposed that MaximumShortTakeProfitPriceRatio must be less than 1 to maintain consistency.

* Add validation checks for parameter

Ensure that higher-bound parameters are greater than lower-bound counterparts in stablestake and perpetual modules. Also, add a combined reward portion check in the masterchef module and improve clarity in error messages for the oracle module.

---------

Co-authored-by: Amit <amy29981@gmail.com>
Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent 07bdc9d commit a31a894
Show file tree
Hide file tree
Showing 270 changed files with 2,451 additions and 6,062 deletions.
2 changes: 0 additions & 2 deletions proto/elys/amm/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ option go_package = "github.com/elys-network/elys/x/amm/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

string pool_creation_fee = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
Expand Down
2 changes: 1 addition & 1 deletion proto/elys/assetprofile/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import "gogoproto/gogo.proto";
option go_package = "github.com/elys-network/elys/x/assetprofile/types";

// Params defines the parameters for the module.
message Params { option (gogoproto.goproto_stringer) = false; }
message Params {}
6 changes: 1 addition & 5 deletions proto/elys/burner/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ import "gogoproto/gogo.proto";
option go_package = "github.com/elys-network/elys/x/burner/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

string epoch_identifier = 1;
}
message Params { string epoch_identifier = 1; }
3 changes: 2 additions & 1 deletion proto/elys/burner/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "elys/burner/params.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/elys-network/elys/x/burner/types";

Expand All @@ -19,7 +20,7 @@ message MsgUpdateParams {
option (amino.name) = "burner/MsgUpdateParams";

string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
Params params = 2;
Params params = 2 [ (gogoproto.nullable) = false ];
}

message MsgUpdateParamsResponse {}
3 changes: 1 addition & 2 deletions proto/elys/commitment/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ option go_package = "github.com/elys-network/elys/x/commitment/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;
repeated VestingInfo vesting_infos = 1;
repeated VestingInfo vesting_infos = 1 [ (gogoproto.nullable) = false ];
repeated cosmos.base.v1beta1.Coin total_committed = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
Expand Down
259 changes: 0 additions & 259 deletions proto/elys/commitment/types_cw.proto

This file was deleted.

2 changes: 0 additions & 2 deletions proto/elys/estaking/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ message LegacyParams {

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

IncentiveInfo stake_incentives = 1;
string eden_commit_val = 2;
string edenb_commit_val = 3;
Expand Down
1 change: 0 additions & 1 deletion proto/elys/leveragelp/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ message LegacyParams {

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;
string leverage_max = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand Down
1 change: 0 additions & 1 deletion proto/elys/masterchef/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ message LegacyParams {
}

message Params {
option (gogoproto.goproto_stringer) = false;
IncentiveInfo lp_incentives = 1;

// gas fees and swap fees portion for lps, `100 - reward_portion_for_lps -
Expand Down
2 changes: 0 additions & 2 deletions proto/elys/oracle/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ option go_package = "github.com/elys-network/elys/x/oracle/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

string band_channel_source = 1;
uint64 oracle_script_id = 2 [ (gogoproto.customname) = "OracleScriptID" ];
uint64 multiplier = 3;
Expand Down
30 changes: 5 additions & 25 deletions proto/elys/parameter/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import "cosmos_proto/cosmos.proto";

option go_package = "github.com/elys-network/elys/x/parameter/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

message LegacyParams {
string min_commission_rate = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand All @@ -30,9 +27,8 @@ message Params {
int64 rewards_data_lifetime = 6; // default 1 day = 86400
}

message LegacyParams {
option (gogoproto.goproto_stringer) = false;

// Params defines the parameters for the module.
message Params {
string min_commission_rate = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand All @@ -48,22 +44,6 @@ message LegacyParams {
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
string broker_address = 4;
int64 total_blocks_per_year = 5;
int64 rewards_data_lifetime = 6; // default 1 day = 86400
string wasm_max_label_size = 7 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
string wasm_max_size = 8 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
string wasm_max_proposal_wasm_size = 9 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
uint64 total_blocks_per_year = 4;
uint64 rewards_data_lifetime = 5; // default 1 day = 86400
}
Loading

0 comments on commit a31a894

Please sign in to comment.