-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fee grant module #8061
Merged
Merged
Add fee grant module #8061
Changes from all commits
Commits
Show all changes
240 commits
Select commit
Hold shift + click to select a range
abce938
Add docs
ethanfrey ea6fe7d
Add BasicFeeAllowance implementation
ethanfrey c46153c
Add expiration structs and complete basic fee
ethanfrey 42c17f5
Add delegation messages, add validation logic
ethanfrey 0c137cb
Add keeper and helper structs
ethanfrey 67cb830
Add alias and handler to top level
ethanfrey f6ba9bc
Add delegation module
ethanfrey a002366
Add basic querier
ethanfrey 15c6361
Add types tests
ethanfrey 410d1f1
Add types tests
ethanfrey f65db09
More internal test coverage
ethanfrey e0f6327
Solid internal test coverage
ethanfrey 93c9b7e
Expose Querier to top level module
ethanfrey 7968441
Add FeeAccount to auth/types, like StdTx, SignDoc
ethanfrey 7e82fb8
Fix all tests in x/auth
ethanfrey 64d5159
All tests pass
ethanfrey 8b2b64b
Appease the Golang Linter
ethanfrey 4e22edd
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey be12b44
Add fee-account command line flag
ethanfrey c703e59
Start on DelegatedDeductFeeDecorator
ethanfrey 907776f
Cleanup the Decorator
ethanfrey 005afd9
Wire up delegation module in simapp
ethanfrey 45c64d2
add basic test for decorator (no delegation)
ethanfrey 87fd0ce
Table tests for deduct fees
ethanfrey d03c650
Table tests over all conditions of delegated fee decorator
ethanfrey e476c03
Build full ante handler stack and test it
ethanfrey 182eb34
Start genesis
ethanfrey 071e111
Implement Genesis
ethanfrey 0a362b8
Merge branch 'master' into cg-key-management/fee-delegation-new
alexanderbez 98b88a3
Rename package delegation to subkeys
ethanfrey 376e9cd
Clarify antes test cases, handle empty account w/o fees
ethanfrey 529764f
Allow paying delegated fees with no account
ethanfrey d293aae
Pull mempool into delegated ante, for control on StdFee
ethanfrey a8b3e31
Use custom DelegatedTx, DelegatedFee for subkeys
ethanfrey e939e98
Revert all changes to x/auth.StdTx
ethanfrey 6aef5c8
Appease scopelint
ethanfrey 1212772
Register DelegatedTx with codec
ethanfrey f688116
Merge branch 'master' into cg-key-management/fee-delegation-new
alexanderbez 61df0c6
Address PR comments
ethanfrey d684f92
Remove unnecessary DelegatedMempoolFeeDecorator
ethanfrey aacf6fb
Cleaned up errors in querier
ethanfrey 92f64cc
Clean up message sign bytes
ethanfrey 4daf4af
Minor PR comments
ethanfrey a497575
Replace GetAllFees... with Iterator variants
ethanfrey 73eab92
PrepareForExport adjusts grant expiration height
ethanfrey 546fa8f
Panic on de/serialization error in keeper
ethanfrey 5f9e391
Move custom ante handler chain to tests, update docs
ethanfrey c45dc71
More cleanup
ethanfrey 2be48ef
More doc cleanup
ethanfrey e8a624f
Renamed subkeys module to fee_grant
ethanfrey 6756099
Rename subkeys/delegation to fee grant in all strings
ethanfrey 320bad4
Modify Msg and Keeper methods to use Grant not Delegate
ethanfrey a625fd0
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey 4b4391b
Add PeriodicFeeAllowance
ethanfrey 9ec284b
Update aliases
ethanfrey 4b34cf6
Cover all accept cases for PeriodicFeeAllowance
ethanfrey 78f1f7a
Et tu scopelint?
ethanfrey a1951b4
Update docs as requested
ethanfrey 17c39ca
Remove error return from GetFeeGrant
ethanfrey 9c399bb
Code cleanup as requested by PR
ethanfrey 6b9e06e
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey 21b0ac5
Updated all errors to use new sdk/errors package
ethanfrey 2222d0e
Use test suite for keeper tests
ethanfrey eda42d4
Clean up alias.go file
ethanfrey a56b472
Define expected interfaces in exported, rather than importing from ac…
ethanfrey be29328
Remove dependency on auth/ante
ethanfrey 786bf01
Improve godoc, Logger
ethanfrey 5f2bcb5
Cleaned up ExpiresAt
ethanfrey 314b099
Improve error reporting with UseGrantedFee
ethanfrey 29958e0
Enforce period limit subset of basic limit
ethanfrey fb5b97a
Add events
ethanfrey eedb8d8
Rename fee_grant to feegrant
ethanfrey 88df255
Ensure KeeperTestSuite actually runs
ethanfrey dbf3578
Move types/tx to types
ethanfrey 375f114
Update alias file, include ante
ethanfrey 9af9f43
I do need nolint in alias.go
ethanfrey 3c390e5
Properly emit events in the handler. Use cosmos-sdk in amino types
ethanfrey de694c5
Merge branch 'master' into bez/enable-fee-auth
alexanderbez 720e9f4
Update godoc
alexanderbez eb46dd0
Linting...
alexanderbez 63cca04
Update errors
alexanderbez 8eddbb7
Update pkg doc and fix ante-handler order
alexanderbez f32db1d
Merge PR #5782: Migrate x/feegrant to proto
sahith-narahari 8dc477a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into bez/enable…
sahith-narahari b8038ee
Merge branch 'master' of github.com:cosmos/cosmos-sdk into bez/enable…
sahith-narahari c34217a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp bd0443c
fix errors
atheeshp 3d72df8
proto changes
atheeshp 8d42ee1
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 2e51274
proto changes
atheeshp 1617e5a
fix errors
atheeshp 76c38ec
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 13f503e
fix errors
atheeshp cb10556
genesis state changed to proto
atheeshp ea8492c
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 7ed4d95
fix keeper tests
atheeshp c89db6d
fix test
atheeshp 37aa0c1
fixed tests
atheeshp aad466a
fix tests
atheeshp d8962c2
updated expected keepers
atheeshp a96d5a5
updated ante tests
atheeshp 550086e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 2c1902b
lint
atheeshp 6c16146
deleted alias.go
atheeshp 755da02
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 1892a3d
tx updated to proto tx
atheeshp 13eea6e
remove explicit signmode
atheeshp 07847ab
tests
atheeshp 29a1fc1
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 85cd87e
Added `cli/query.go`
atheeshp 24b1c9a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp d838333
Added tx.go in cli
atheeshp 0a258ac
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 695b143
updated `module.go`
atheeshp e59e303
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 9ea89d9
resolve errors in tx.go
atheeshp debec04
Add fee payer gentx func
atheeshp fc4543d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 865f70e
updated tx
atheeshp 3b43fef
fixed error
atheeshp 3c69591
WIP: cli tests
atheeshp 5eb8f22
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp ec9dad3
fix query error
atheeshp f69d5dd
fix tests
atheeshp e424be4
Unused types and funcs
atheeshp 1d54333
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp a5483f9
fix tests
atheeshp 1907c0c
rename helper func to create tx
atheeshp eedc5a5
remove unused
atheeshp 182507f
update tx cfg
atheeshp bab66dd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 3e00831
fix cli tests
atheeshp 922a437
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp dc6eeb6
added simulations
atheeshp 738bdd0
Add `decoder.go`
atheeshp d06fb86
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp c5abc6e
fix build fail
atheeshp 9f74c5d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 5adf5fe
added init genesis code
atheeshp d2f494c
update tx.go
atheeshp 14f6183
fixed LGTM alert
atheeshp 5f69caa
modified cli
atheeshp bd96862
remove gogoproto extensions
aleem1314 07da6b0
change acc address type to string
aleem1314 eba8213
lint
aleem1314 287b6ac
fix simulations
aleem1314 8b11072
Add gen simulations
atheeshp 4ca4304
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 5aaf0c5
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp 1884fb7
remove legacy querier
aleem1314 5ffc768
remove legacy code
aleem1314 e735ad8
add grpc queries tests
aleem1314 9600bbf
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 dff0c63
fix simulations
aleem1314 b8f2f02
update module.go
aleem1314 79e71ad
lint
aleem1314 2a62fb9
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 7e74e35
register feegrant NewSimulationManager
aleem1314 ad3d8c4
Merge branch 'atheesh/x-fee-grant' of https://github.com/cosmos/cosmo…
aleem1314 8061f2d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 1ea308a
fix sims
atheeshp 38ff641
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 89ef367
fix sims
atheeshp 9bd77ae
add genesis test
aleem1314 980b7db
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 0e48652
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp c9d5f81
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp 26238b2
add periodic grant
atheeshp 0225e2d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp bef09b7
updated cmd
atheeshp d8fd446
changed times
atheeshp d7c63fb
updated flags
atheeshp b656a14
removed days as period clock
atheeshp 458e76e
added condition for period and exp
atheeshp d5d948c
add periodic fee cli tests
atheeshp fc9b0dc
udpated tests
atheeshp 35fe6a7
fix lint
atheeshp db78a92
fix tests
atheeshp 0692eb0
fix sims
atheeshp a153873
renaming to `fee_grant`
atheeshp cf547d9
review changes
atheeshp ba0f83a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp a893e92
fix test
atheeshp ba9dd4a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 9a68d51
add condition for duplicate grants
atheeshp 90c3e7f
fix tests
atheeshp 1a056a9
add `genTxWithFeeGranter` in tests
atheeshp bfeb2d9
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp ec5129a
fix simulation
atheeshp 24fbc1a
Merge branch 'master' into atheesh/x-fee-grant
atheeshp de83e01
one of changes & test fixes
atheeshp 5b5a0fc
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 7131468
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp 35bd132
fix test
atheeshp b0299a4
fix lint
atheeshp 3031218
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 6701433
changed package name `feegrant` to `fee_grant`
atheeshp f484c58
review comments
atheeshp a05a4c6
review changes
atheeshp fa5b4f2
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 25f18d8
review change
atheeshp b283eb7
review changes
atheeshp 7bf2195
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 958715e
Merge branch 'master' into atheesh/x-fee-grant
anilcse 96bc2ae
added fee-account in flags
atheeshp 6716ffa
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 99c65bd
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp b0d5f7d
address review changes
atheeshp f40ed08
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp c234b1a
read fee granter from cli
atheeshp 605b530
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 35d9fb1
updated create account with mnemonic
atheeshp f5fae0f
Address review comments
atheeshp f2998e7
move `simapp/ante` file to `feegrant/ante`
atheeshp a22c736
update keeper logic to create account
atheeshp 9efd541
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 27c9182
update docs
atheeshp d3423bf
fix tests
atheeshp 0ff9ade
update `serviceMsgClientConn` from `msgservice`
atheeshp a0d67bd
review changes
atheeshp 3497817
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 65547e7
add test case for using more fees than allowed
atheeshp fa01503
eliminate panic checks from keeper
atheeshp 4c091fd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp 86714f1
fix lint
atheeshp 1d6f9cf
change store keys string to bytes
atheeshp e908652
fix tests
atheeshp e5d2610
review changes
atheeshp 0ffebce
review changes
atheeshp fa37825
udpate docs
atheeshp f2b616f
make spend limit optional
atheeshp d2cc66e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp c172cca
fix tests
atheeshp 8d8f137
fix tests
atheeshp 3dfb3ab
review changes
atheeshp 3398c46
add norace tag
atheeshp a344c78
proto-docs
atheeshp 6509b55
add docs
atheeshp fc5b9e1
Merge branch 'master' into atheesh/x-fee-grant
atheeshp 4987bd0
Merge branch 'master' into atheesh/x-fee-grant
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
syntax = "proto3"; | ||
package cosmos.feegrant.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "google/protobuf/duration.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant/types"; | ||
|
||
// BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens | ||
// that optionally expires. The delegatee can use up to SpendLimit to cover fees. | ||
message BasicFeeAllowance { | ||
option (cosmos_proto.implements_interface) = "FeeAllowanceI"; | ||
|
||
// spend_limit specifies the maximum amount of tokens that can be spent | ||
// by this allowance and will be updated as tokens are spent. If it is | ||
// empty, there is no spend limit and any amount of coins can be spent. | ||
repeated cosmos.base.v1beta1.Coin spend_limit = 1 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; | ||
|
||
// expiration specifies an optional time when this allowance expires | ||
ExpiresAt expiration = 2 [(gogoproto.nullable) = false]; | ||
amaury1093 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, | ||
// as well as a limit per time period. | ||
message PeriodicFeeAllowance { | ||
option (cosmos_proto.implements_interface) = "FeeAllowanceI"; | ||
|
||
// basic specifies a struct of `BasicFeeAllowance` | ||
BasicFeeAllowance basic = 1 [(gogoproto.nullable) = false]; | ||
|
||
// period specifies the time duration in which period_spend_limit coins can | ||
// be spent before that allowance is reset | ||
Duration period = 2 [(gogoproto.nullable) = false]; | ||
|
||
// period_spend_limit specifies the maximum number of coins that can be spent | ||
// in the period | ||
repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; | ||
|
||
// period_can_spend is the number of coins left to be spent before the period_reset time | ||
repeated cosmos.base.v1beta1.Coin period_can_spend = 4 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; | ||
|
||
// period_reset is the time at which this period resets and a new one begins, | ||
// it is calculated from the start time of the first transaction after the | ||
// last period ended | ||
ExpiresAt period_reset = 5 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// Duration is a span of a clock time or number of blocks. | ||
// This is designed to be added to an ExpiresAt struct. | ||
message Duration { | ||
// sum is the oneof that represents either duration or block | ||
oneof sum { | ||
google.protobuf.Duration duration = 1 [(gogoproto.stdduration) = true]; | ||
uint64 blocks = 2; | ||
} | ||
} | ||
|
||
// ExpiresAt is a point in time where something expires. | ||
// It may be *either* block time or block height | ||
message ExpiresAt { | ||
// sum is the oneof that represents either time or height | ||
oneof sum { | ||
google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true]; | ||
int64 height = 2; | ||
} | ||
} | ||
|
||
// FeeAllowanceGrant is stored in the KVStore to record a grant with full context | ||
message FeeAllowanceGrant { | ||
|
||
string granter = 1; | ||
string grantee = 2; | ||
google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; | ||
} |
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,12 @@ | ||
syntax = "proto3"; | ||
package cosmos.feegrant.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/feegrant/v1beta1/feegrant.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant/types"; | ||
|
||
// GenesisState contains a set of fee allowances, persisted from the store | ||
message GenesisState { | ||
repeated FeeAllowanceGrant fee_allowances = 1 [(gogoproto.nullable) = false]; | ||
} |
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,52 @@ | ||
syntax = "proto3"; | ||
package cosmos.feegrant.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/feegrant/v1beta1/feegrant.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "google/api/annotations.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
|
||
// FeeAllowance returns fee granted to the grantee by the granter. | ||
atheeshp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rpc FeeAllowance(QueryFeeAllowanceRequest) returns (QueryFeeAllowanceResponse) { | ||
option (google.api.http).get = "/cosmos/feegrant/v1beta1/fee_allowance/{granter}/{grantee}"; | ||
} | ||
|
||
// FeeAllowances returns all the grants for address. | ||
rpc FeeAllowances(QueryFeeAllowancesRequest) returns (QueryFeeAllowancesResponse) { | ||
option (google.api.http).get = "/cosmos/feegrant/v1beta1/fee_allowances/{grantee}"; | ||
} | ||
} | ||
|
||
// QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. | ||
message QueryFeeAllowanceRequest { | ||
string granter = 1; | ||
string grantee = 2; | ||
} | ||
|
||
// QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. | ||
message QueryFeeAllowanceResponse { | ||
// fee_allowance is a fee_allowance granted for grantee by granter. | ||
cosmos.feegrant.v1beta1.FeeAllowanceGrant fee_allowance = 1; | ||
} | ||
|
||
// QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. | ||
message QueryFeeAllowancesRequest { | ||
string grantee = 1; | ||
|
||
// pagination defines an pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. | ||
message QueryFeeAllowancesResponse { | ||
// fee_allowances are fee_allowance's granted for grantee by granter. | ||
repeated cosmos.feegrant.v1beta1.FeeAllowanceGrant fee_allowances = 1; | ||
|
||
// pagination defines an pagination for the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} |
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,40 @@ | ||
syntax = "proto3"; | ||
package cosmos.feegrant.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant/types"; | ||
|
||
// Msg defines the feegrant msg service. | ||
service Msg { | ||
|
||
// GrantFeeAllowance grants fee allowance to the grantee on the granter's | ||
// account with the provided expiration time. | ||
rpc GrantFeeAllowance(MsgGrantFeeAllowance) returns (MsgGrantFeeAllowanceResponse); | ||
|
||
// RevokeFeeAllowance revokes any fee allowance of granter's account that | ||
// has been granted to the grantee. | ||
rpc RevokeFeeAllowance(MsgRevokeFeeAllowance) returns (MsgRevokeFeeAllowanceResponse); | ||
amaury1093 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance | ||
// of fees from the account of Granter. | ||
message MsgGrantFeeAllowance { | ||
string granter = 1; | ||
string grantee = 2; | ||
google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; | ||
} | ||
|
||
// MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. | ||
message MsgGrantFeeAllowanceResponse {} | ||
|
||
// MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. | ||
message MsgRevokeFeeAllowance { | ||
string granter = 1; | ||
string grantee = 2; | ||
} | ||
|
||
// MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. | ||
message MsgRevokeFeeAllowanceResponse {} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.