-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* gov.proto -> tx.proto * updated tx protos * added proto comments * added proto comments * updated codec.go * added msgs * added msgs tests * added authority to keeper and removed gov handlers * moved gov functions out to msg server * implemented msg_server * updated msg_server tests * removed tx client * updated simapp * go mod tidy * fixed msgs_tests * fixed msg_server tests * changes from review * moved add/update rate limit to outside msg_server * file re-org * nit moved function
- Loading branch information
Showing
42 changed files
with
4,287 additions
and
4,233 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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
syntax = "proto3"; | ||
package ratelimit.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "amino/amino.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
|
||
option go_package = "github.com/Stride-Labs/ibc-rate-limiting/ratelimit/types"; | ||
|
||
// Msg service for rate limit txs | ||
service Msg { | ||
// Gov tx to add a new rate limit | ||
rpc AddRateLimit(MsgAddRateLimit) returns (MsgAddRateLimitResponse); | ||
// Gov tx to update an existing rate limit | ||
rpc UpdateRateLimit(MsgUpdateRateLimit) returns (MsgUpdateRateLimitResponse); | ||
// Gov tx to remove a rate limit | ||
rpc RemoveRateLimit(MsgRemoveRateLimit) returns (MsgRemoveRateLimitResponse); | ||
// Gov tx to reset the flow on a rate limit | ||
rpc ResetRateLimit(MsgResetRateLimit) returns (MsgResetRateLimitResponse); | ||
} | ||
|
||
// Gov tx to add a new rate limit | ||
message MsgAddRateLimit { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "ratelimit/MsgAddRateLimit"; | ||
|
||
// Authority defines the x/gov module account | ||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// Denom for the rate limit, as it appears on the rate limited chain | ||
// When rate limiting a non-native token, this will be an ibc denom | ||
string denom = 2; | ||
// ChannelId for the rate limit, on the side of the rate limited chain | ||
string channel_id = 3; | ||
// MaxPercentSend defines the threshold for outflows | ||
// The threshold is defined as a percentage (e.g. 10 indicates 10%) | ||
string max_percent_send = 4 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
// MaxPercentSend defines the threshold for inflows | ||
// The threshold is defined as a percentage (e.g. 10 indicates 10%) | ||
string max_percent_recv = 5 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
// DurationHours specifies the number of hours before the rate limit | ||
// is reset (e.g. 24 indicates that the rate limit is reset each day) | ||
uint64 duration_hours = 6; | ||
} | ||
message MsgAddRateLimitResponse {} | ||
|
||
// Gov tx to update an existing rate limit | ||
message MsgUpdateRateLimit { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "ratelimit/MsgUpdateRateLimit"; | ||
|
||
// Authority defines the x/gov module account | ||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// Denom for the rate limit, as it appears on the rate limited chain | ||
// When rate limiting a non-native token, this will be an ibc denom | ||
string denom = 2; | ||
// ChannelId for the rate limit, on the side of the rate limited chain | ||
string channel_id = 3; | ||
// MaxPercentSend defines the threshold for outflows | ||
// The threshold is defined as a percentage (e.g. 10 indicates 10%) | ||
string max_percent_send = 4 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
// MaxPercentSend defines the threshold for inflows | ||
// The threshold is defined as a percentage (e.g. 10 indicates 10%) | ||
string max_percent_recv = 5 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
// DurationHours specifies the number of hours before the rate limit | ||
// is reset (e.g. 24 indicates that the rate limit is reset each day) | ||
uint64 duration_hours = 6; | ||
} | ||
message MsgUpdateRateLimitResponse {} | ||
|
||
// Gov tx to remove a rate limit | ||
message MsgRemoveRateLimit { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "ratelimit/MsgRemoveRateLimit"; | ||
|
||
// Authority defines the x/gov module account | ||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// Denom for the rate limit, as it appears on the rate limited chain | ||
// When rate limiting a non-native token, this will be an ibc denom | ||
string denom = 2; | ||
// ChannelId for the rate limit, on the side of the rate limited chain | ||
string channel_id = 3; | ||
} | ||
message MsgRemoveRateLimitResponse {} | ||
|
||
// Gov tx to reset the flow on a rate limit | ||
message MsgResetRateLimit { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "ratelimit/MsgResetRateLimit"; | ||
|
||
// Authority defines the x/gov module account | ||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; | ||
// Denom for the rate limit, as it appears on the rate limited chain | ||
// When rate limiting a non-native token, this will be an ibc denom | ||
string denom = 2; | ||
// ChannelId for the rate limit, on the side of the rate limited chain | ||
string channel_id = 3; | ||
} | ||
message MsgResetRateLimitResponse {} |
Oops, something went wrong.