From 142cf679783f9c639f0b19e84ae6784dd616c4dd Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 11 Mar 2022 20:14:44 +0530 Subject: [PATCH] docs: update feegrant `AllowedFeeAllowance` docs (#11344) ## Description Closes: #11346 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- proto/cosmos/feegrant/v1beta1/feegrant.proto | 4 ++-- proto/cosmos/feegrant/v1beta1/tx.proto | 2 +- x/feegrant/feegrant.pb.go | 4 ++-- x/feegrant/spec/01_concepts.md | 11 +++++++++++ x/feegrant/tx.pb.go | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto index 769490c59..eca71e2b9 100644 --- a/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ b/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -58,7 +58,7 @@ message AllowedMsgAllowance { option (gogoproto.goproto_getters) = false; option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic and periodic fee allowance. google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; // allowed_messages are the messages for which the grantee has the access. @@ -73,6 +73,6 @@ message Grant { // grantee is the address of the user being granted an allowance of another user's funds. string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic, periodic, allowed fee allowance. google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; } diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto index 16dd1a920..a12d9aaab 100644 --- a/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -31,7 +31,7 @@ message MsgGrantAllowance { // grantee is the address of the user being granted an allowance of another user's funds. string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic, periodic, allowed fee allowance. google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; } diff --git a/x/feegrant/feegrant.pb.go b/x/feegrant/feegrant.pb.go index 4b75f267a..5d764e84b 100644 --- a/x/feegrant/feegrant.pb.go +++ b/x/feegrant/feegrant.pb.go @@ -179,7 +179,7 @@ func (m *PeriodicAllowance) GetPeriodReset() time.Time { // AllowedMsgAllowance creates allowance only for specified message types. type AllowedMsgAllowance struct { - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic and periodic fee allowance. Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` // allowed_messages are the messages for which the grantee has the access. AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"` @@ -224,7 +224,7 @@ type Grant struct { Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` // grantee is the address of the user being granted an allowance of another user's funds. Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic, periodic, allowed fee allowance. Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` } diff --git a/x/feegrant/spec/01_concepts.md b/x/feegrant/spec/01_concepts.md index a4571f8a9..523ff3e94 100644 --- a/x/feegrant/spec/01_concepts.md +++ b/x/feegrant/spec/01_concepts.md @@ -20,6 +20,7 @@ There are two types of fee allowances present at the moment: * `BasicAllowance` * `PeriodicAllowance` +* `AllowedMsgAllowance` ## BasicAllowance @@ -49,6 +50,16 @@ There are two types of fee allowances present at the moment: * `period_reset` keeps track of when a next period reset should happen. +## AllowedMsgAllowance + +`AllowedMsgAllowance` is a fee allowance, it can be any of `BasicFeeAllowance`, `PeriodicAllowance` but restricted only to the allowed messages mentioned by the granter. + ++++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/feegrant.proto#L55-L65 + +* `allowance` is either `BasicAllowance` or `PeriodicAllowance`. + +* `allowed_messages` is array of messages allowed to execute the given allowance. + ## FeeGranter flag `feegrant` module introduces a `FeeGranter` flag for CLI for the sake of executing transactions with fee granter. When this flag is set, `clientCtx` will append the granter account address for transactions generated through CLI. diff --git a/x/feegrant/tx.pb.go b/x/feegrant/tx.pb.go index af208f286..be7c9cfd4 100644 --- a/x/feegrant/tx.pb.go +++ b/x/feegrant/tx.pb.go @@ -37,7 +37,7 @@ type MsgGrantAllowance struct { Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` // grantee is the address of the user being granted an allowance of another user's funds. Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - // allowance can be any of basic and filtered fee allowance. + // allowance can be any of basic, periodic, allowed fee allowance. Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` }