Skip to content
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 240 commits into from
Jan 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
abce938
Add docs
ethanfrey Oct 16, 2019
ea6fe7d
Add BasicFeeAllowance implementation
ethanfrey Oct 16, 2019
c46153c
Add expiration structs and complete basic fee
ethanfrey Oct 16, 2019
42c17f5
Add delegation messages, add validation logic
ethanfrey Oct 16, 2019
0c137cb
Add keeper and helper structs
ethanfrey Oct 16, 2019
67cb830
Add alias and handler to top level
ethanfrey Oct 16, 2019
f6ba9bc
Add delegation module
ethanfrey Oct 16, 2019
a002366
Add basic querier
ethanfrey Oct 16, 2019
15c6361
Add types tests
ethanfrey Oct 16, 2019
410d1f1
Add types tests
ethanfrey Oct 16, 2019
f65db09
More internal test coverage
ethanfrey Oct 16, 2019
e0f6327
Solid internal test coverage
ethanfrey Oct 16, 2019
93c9b7e
Expose Querier to top level module
ethanfrey Oct 16, 2019
7968441
Add FeeAccount to auth/types, like StdTx, SignDoc
ethanfrey Oct 16, 2019
7e82fb8
Fix all tests in x/auth
ethanfrey Oct 16, 2019
64d5159
All tests pass
ethanfrey Oct 16, 2019
8b2b64b
Appease the Golang Linter
ethanfrey Oct 16, 2019
4e22edd
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey Oct 16, 2019
be12b44
Add fee-account command line flag
ethanfrey Oct 16, 2019
c703e59
Start on DelegatedDeductFeeDecorator
ethanfrey Oct 17, 2019
907776f
Cleanup the Decorator
ethanfrey Oct 17, 2019
005afd9
Wire up delegation module in simapp
ethanfrey Oct 17, 2019
45c64d2
add basic test for decorator (no delegation)
ethanfrey Oct 17, 2019
87fd0ce
Table tests for deduct fees
ethanfrey Oct 17, 2019
d03c650
Table tests over all conditions of delegated fee decorator
ethanfrey Oct 17, 2019
e476c03
Build full ante handler stack and test it
ethanfrey Oct 17, 2019
182eb34
Start genesis
ethanfrey Oct 17, 2019
071e111
Implement Genesis
ethanfrey Oct 17, 2019
0a362b8
Merge branch 'master' into cg-key-management/fee-delegation-new
alexanderbez Oct 17, 2019
98b88a3
Rename package delegation to subkeys
ethanfrey Oct 18, 2019
376e9cd
Clarify antes test cases, handle empty account w/o fees
ethanfrey Oct 18, 2019
529764f
Allow paying delegated fees with no account
ethanfrey Oct 18, 2019
d293aae
Pull mempool into delegated ante, for control on StdFee
ethanfrey Oct 18, 2019
a8b3e31
Use custom DelegatedTx, DelegatedFee for subkeys
ethanfrey Oct 18, 2019
e939e98
Revert all changes to x/auth.StdTx
ethanfrey Oct 18, 2019
6aef5c8
Appease scopelint
ethanfrey Oct 18, 2019
1212772
Register DelegatedTx with codec
ethanfrey Oct 18, 2019
f688116
Merge branch 'master' into cg-key-management/fee-delegation-new
alexanderbez Oct 18, 2019
61df0c6
Address PR comments
ethanfrey Oct 21, 2019
d684f92
Remove unnecessary DelegatedMempoolFeeDecorator
ethanfrey Oct 21, 2019
aacf6fb
Cleaned up errors in querier
ethanfrey Oct 21, 2019
92f64cc
Clean up message sign bytes
ethanfrey Oct 21, 2019
4daf4af
Minor PR comments
ethanfrey Oct 24, 2019
a497575
Replace GetAllFees... with Iterator variants
ethanfrey Oct 24, 2019
73eab92
PrepareForExport adjusts grant expiration height
ethanfrey Oct 24, 2019
546fa8f
Panic on de/serialization error in keeper
ethanfrey Oct 24, 2019
5f9e391
Move custom ante handler chain to tests, update docs
ethanfrey Oct 24, 2019
c45dc71
More cleanup
ethanfrey Oct 24, 2019
2be48ef
More doc cleanup
ethanfrey Oct 24, 2019
e8a624f
Renamed subkeys module to fee_grant
ethanfrey Oct 24, 2019
6756099
Rename subkeys/delegation to fee grant in all strings
ethanfrey Oct 24, 2019
320bad4
Modify Msg and Keeper methods to use Grant not Delegate
ethanfrey Oct 24, 2019
a625fd0
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey Oct 24, 2019
4b4391b
Add PeriodicFeeAllowance
ethanfrey Oct 29, 2019
9ec284b
Update aliases
ethanfrey Oct 29, 2019
4b34cf6
Cover all accept cases for PeriodicFeeAllowance
ethanfrey Oct 29, 2019
78f1f7a
Et tu scopelint?
ethanfrey Oct 29, 2019
a1951b4
Update docs as requested
ethanfrey Nov 7, 2019
17c39ca
Remove error return from GetFeeGrant
ethanfrey Nov 7, 2019
9c399bb
Code cleanup as requested by PR
ethanfrey Nov 7, 2019
6b9e06e
Merge remote-tracking branch 'origin/master' into cg-key-management/f…
ethanfrey Nov 7, 2019
21b0ac5
Updated all errors to use new sdk/errors package
ethanfrey Nov 7, 2019
2222d0e
Use test suite for keeper tests
ethanfrey Nov 7, 2019
eda42d4
Clean up alias.go file
ethanfrey Nov 7, 2019
a56b472
Define expected interfaces in exported, rather than importing from ac…
ethanfrey Nov 7, 2019
be29328
Remove dependency on auth/ante
ethanfrey Nov 7, 2019
786bf01
Improve godoc, Logger
ethanfrey Nov 7, 2019
5f2bcb5
Cleaned up ExpiresAt
ethanfrey Nov 7, 2019
314b099
Improve error reporting with UseGrantedFee
ethanfrey Nov 7, 2019
29958e0
Enforce period limit subset of basic limit
ethanfrey Nov 7, 2019
fb5b97a
Add events
ethanfrey Nov 7, 2019
eedb8d8
Rename fee_grant to feegrant
ethanfrey Nov 7, 2019
88df255
Ensure KeeperTestSuite actually runs
ethanfrey Nov 7, 2019
dbf3578
Move types/tx to types
ethanfrey Nov 7, 2019
375f114
Update alias file, include ante
ethanfrey Nov 7, 2019
9af9f43
I do need nolint in alias.go
ethanfrey Nov 7, 2019
3c390e5
Properly emit events in the handler. Use cosmos-sdk in amino types
ethanfrey Nov 7, 2019
de694c5
Merge branch 'master' into bez/enable-fee-auth
alexanderbez Mar 9, 2020
720e9f4
Update godoc
alexanderbez Mar 9, 2020
eb46dd0
Linting...
alexanderbez Mar 9, 2020
63cca04
Update errors
alexanderbez Mar 9, 2020
8eddbb7
Update pkg doc and fix ante-handler order
alexanderbez Mar 9, 2020
f32db1d
Merge PR #5782: Migrate x/feegrant to proto
sahith-narahari Apr 7, 2020
8dc477a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into bez/enable…
sahith-narahari May 27, 2020
b8038ee
Merge branch 'master' of github.com:cosmos/cosmos-sdk into bez/enable…
sahith-narahari Jun 8, 2020
c34217a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Nov 25, 2020
bd0443c
fix errors
atheeshp Nov 25, 2020
3d72df8
proto changes
atheeshp Nov 26, 2020
8d42ee1
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Nov 26, 2020
2e51274
proto changes
atheeshp Nov 26, 2020
1617e5a
fix errors
atheeshp Nov 26, 2020
76c38ec
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Nov 26, 2020
13f503e
fix errors
atheeshp Nov 26, 2020
cb10556
genesis state changed to proto
atheeshp Dec 1, 2020
ea8492c
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 1, 2020
7ed4d95
fix keeper tests
atheeshp Dec 1, 2020
c89db6d
fix test
atheeshp Dec 1, 2020
37aa0c1
fixed tests
atheeshp Dec 2, 2020
aad466a
fix tests
atheeshp Dec 2, 2020
d8962c2
updated expected keepers
atheeshp Dec 2, 2020
a96d5a5
updated ante tests
atheeshp Dec 2, 2020
550086e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 2, 2020
2c1902b
lint
atheeshp Dec 2, 2020
6c16146
deleted alias.go
atheeshp Dec 3, 2020
755da02
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 3, 2020
1892a3d
tx updated to proto tx
atheeshp Dec 5, 2020
13eea6e
remove explicit signmode
atheeshp Dec 5, 2020
07847ab
tests
atheeshp Dec 7, 2020
29a1fc1
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 7, 2020
85cd87e
Added `cli/query.go`
atheeshp Dec 7, 2020
24b1c9a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 7, 2020
d838333
Added tx.go in cli
atheeshp Dec 7, 2020
0a258ac
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 7, 2020
695b143
updated `module.go`
atheeshp Dec 7, 2020
e59e303
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 7, 2020
9ea89d9
resolve errors in tx.go
atheeshp Dec 7, 2020
debec04
Add fee payer gentx func
atheeshp Dec 8, 2020
fc4543d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 8, 2020
865f70e
updated tx
atheeshp Dec 8, 2020
3b43fef
fixed error
atheeshp Dec 9, 2020
3c69591
WIP: cli tests
atheeshp Dec 9, 2020
5eb8f22
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 9, 2020
ec9dad3
fix query error
atheeshp Dec 9, 2020
f69d5dd
fix tests
atheeshp Dec 11, 2020
e424be4
Unused types and funcs
atheeshp Dec 11, 2020
1d54333
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 11, 2020
a5483f9
fix tests
atheeshp Dec 13, 2020
1907c0c
rename helper func to create tx
atheeshp Dec 13, 2020
eedc5a5
remove unused
atheeshp Dec 13, 2020
182507f
update tx cfg
atheeshp Dec 13, 2020
bab66dd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 13, 2020
3e00831
fix cli tests
atheeshp Dec 14, 2020
922a437
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 14, 2020
dc6eeb6
added simulations
atheeshp Dec 15, 2020
738bdd0
Add `decoder.go`
atheeshp Dec 15, 2020
d06fb86
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 15, 2020
c5abc6e
fix build fail
atheeshp Dec 16, 2020
9f74c5d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 16, 2020
5adf5fe
added init genesis code
atheeshp Dec 16, 2020
d2f494c
update tx.go
atheeshp Dec 16, 2020
14f6183
fixed LGTM alert
atheeshp Dec 16, 2020
5f69caa
modified cli
atheeshp Dec 16, 2020
bd96862
remove gogoproto extensions
aleem1314 Dec 16, 2020
07da6b0
change acc address type to string
aleem1314 Dec 16, 2020
eba8213
lint
aleem1314 Dec 16, 2020
287b6ac
fix simulations
aleem1314 Dec 16, 2020
8b11072
Add gen simulations
atheeshp Dec 16, 2020
4ca4304
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 16, 2020
5aaf0c5
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp Dec 16, 2020
1884fb7
remove legacy querier
aleem1314 Dec 17, 2020
5ffc768
remove legacy code
aleem1314 Dec 17, 2020
e735ad8
add grpc queries tests
aleem1314 Dec 17, 2020
9600bbf
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 Dec 17, 2020
dff0c63
fix simulations
aleem1314 Dec 19, 2020
b8f2f02
update module.go
aleem1314 Dec 19, 2020
79e71ad
lint
aleem1314 Dec 19, 2020
2a62fb9
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 Dec 19, 2020
7e74e35
register feegrant NewSimulationManager
aleem1314 Dec 19, 2020
ad3d8c4
Merge branch 'atheesh/x-fee-grant' of https://github.com/cosmos/cosmo…
aleem1314 Dec 19, 2020
8061f2d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 21, 2020
1ea308a
fix sims
atheeshp Dec 21, 2020
38ff641
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 21, 2020
89ef367
fix sims
atheeshp Dec 21, 2020
9bd77ae
add genesis test
aleem1314 Dec 22, 2020
980b7db
Merge branch 'master' into atheesh/x-fee-grant
aleem1314 Dec 22, 2020
0e48652
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 22, 2020
c9d5f81
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp Dec 22, 2020
26238b2
add periodic grant
atheeshp Dec 23, 2020
0225e2d
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Dec 23, 2020
bef09b7
updated cmd
atheeshp Dec 23, 2020
d8fd446
changed times
atheeshp Dec 23, 2020
d7c63fb
updated flags
atheeshp Dec 23, 2020
b656a14
removed days as period clock
atheeshp Dec 23, 2020
458e76e
added condition for period and exp
atheeshp Dec 23, 2020
d5d948c
add periodic fee cli tests
atheeshp Dec 23, 2020
fc9b0dc
udpated tests
atheeshp Dec 23, 2020
35fe6a7
fix lint
atheeshp Dec 23, 2020
db78a92
fix tests
atheeshp Dec 23, 2020
0692eb0
fix sims
atheeshp Dec 23, 2020
a153873
renaming to `fee_grant`
atheeshp Jan 11, 2021
cf547d9
review changes
atheeshp Jan 11, 2021
ba0f83a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 11, 2021
a893e92
fix test
atheeshp Jan 12, 2021
ba9dd4a
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 12, 2021
9a68d51
add condition for duplicate grants
atheeshp Jan 12, 2021
90c3e7f
fix tests
atheeshp Jan 12, 2021
1a056a9
add `genTxWithFeeGranter` in tests
atheeshp Jan 12, 2021
bfeb2d9
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 12, 2021
ec5129a
fix simulation
atheeshp Jan 12, 2021
24fbc1a
Merge branch 'master' into atheesh/x-fee-grant
atheeshp Jan 13, 2021
de83e01
one of changes & test fixes
atheeshp Jan 18, 2021
5b5a0fc
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 18, 2021
7131468
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp Jan 18, 2021
35bd132
fix test
atheeshp Jan 18, 2021
b0299a4
fix lint
atheeshp Jan 18, 2021
3031218
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 19, 2021
6701433
changed package name `feegrant` to `fee_grant`
atheeshp Jan 19, 2021
f484c58
review comments
atheeshp Jan 19, 2021
a05a4c6
review changes
atheeshp Jan 19, 2021
fa5b4f2
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 19, 2021
25f18d8
review change
atheeshp Jan 19, 2021
b283eb7
review changes
atheeshp Jan 20, 2021
7bf2195
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 20, 2021
958715e
Merge branch 'master' into atheesh/x-fee-grant
anilcse Jan 21, 2021
96bc2ae
added fee-account in flags
atheeshp Jan 21, 2021
6716ffa
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 21, 2021
99c65bd
Merge branch 'atheesh/x-fee-grant' of github.com:cosmos/cosmos-sdk in…
atheeshp Jan 21, 2021
b0d5f7d
address review changes
atheeshp Jan 22, 2021
f40ed08
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 22, 2021
c234b1a
read fee granter from cli
atheeshp Jan 25, 2021
605b530
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 25, 2021
35d9fb1
updated create account with mnemonic
atheeshp Jan 25, 2021
f5fae0f
Address review comments
atheeshp Jan 25, 2021
f2998e7
move `simapp/ante` file to `feegrant/ante`
atheeshp Jan 25, 2021
a22c736
update keeper logic to create account
atheeshp Jan 25, 2021
9efd541
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 25, 2021
27c9182
update docs
atheeshp Jan 25, 2021
d3423bf
fix tests
atheeshp Jan 25, 2021
0ff9ade
update `serviceMsgClientConn` from `msgservice`
atheeshp Jan 25, 2021
a0d67bd
review changes
atheeshp Jan 27, 2021
3497817
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 27, 2021
65547e7
add test case for using more fees than allowed
atheeshp Jan 27, 2021
fa01503
eliminate panic checks from keeper
atheeshp Jan 27, 2021
4c091fd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 27, 2021
86714f1
fix lint
atheeshp Jan 27, 2021
1d6f9cf
change store keys string to bytes
atheeshp Jan 27, 2021
e908652
fix tests
atheeshp Jan 27, 2021
e5d2610
review changes
atheeshp Jan 27, 2021
0ffebce
review changes
atheeshp Jan 27, 2021
fa37825
udpate docs
atheeshp Jan 27, 2021
f2b616f
make spend limit optional
atheeshp Jan 28, 2021
d2cc66e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/x-…
atheeshp Jan 28, 2021
c172cca
fix tests
atheeshp Jan 28, 2021
8d8f137
fix tests
atheeshp Jan 28, 2021
3dfb3ab
review changes
atheeshp Jan 28, 2021
3398c46
add norace tag
atheeshp Jan 28, 2021
a344c78
proto-docs
atheeshp Jan 28, 2021
6509b55
add docs
atheeshp Jan 28, 2021
fc5b9e1
Merge branch 'master' into atheesh/x-fee-grant
atheeshp Jan 29, 2021
4987bd0
Merge branch 'master' into atheesh/x-fee-grant
mergify[bot] Jan 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deleted alias.go
atheeshp committed Dec 3, 2020
commit 6c16146dc52467f26f53020f6ca04ab39f2f8370
7 changes: 4 additions & 3 deletions simapp/ante.go
Original file line number Diff line number Diff line change
@@ -6,15 +6,16 @@ import (
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantante "github.com/cosmos/cosmos-sdk/x/feegrant/ante"
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant/types"
)

// NewAnteHandler returns an AnteHandler that checks and increments sequence
// numbers, checks signatures & account numbers, and deducts fees from the first
// signer.
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
func NewAnteHandler(
ak authkeeper.AccountKeeper, supplyKeeper feegrant.SupplyKeeper, feeGrantKeeper feegrant.Keeper,
ak authkeeper.AccountKeeper, bankKeeper feegranttypes.BankKeeper, feeGrantKeeper feegrantkeeper.Keeper,
sigGasConsumer authante.SignatureVerificationGasConsumer,
) sdk.AnteHandler {

@@ -28,7 +29,7 @@ func NewAnteHandler(
// DeductGrantedFeeDecorator will create an empty account if we sign with no
// tokens but valid validation. This must be before SetPubKey, ValidateSigCount,
// SigVerification, which error if account doesn't exist yet.
feegrantante.NewDeductGrantedFeeDecorator(ak, supplyKeeper, feeGrantKeeper),
feegrantante.NewDeductGrantedFeeDecorator(ak, bankKeeper, feeGrantKeeper),
authante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators
authante.NewValidateSigCountDecorator(ak),
authante.NewSigGasConsumeDecorator(ak, sigGasConsumer),
10 changes: 6 additions & 4 deletions simapp/app.go
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ import (
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/gov"
@@ -176,7 +178,7 @@ type SimApp struct {
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrant.Keeper
FeeGrantKeeper feegrantkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
@@ -219,7 +221,7 @@ func NewSimApp(
keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegranttypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
@@ -274,7 +276,7 @@ func NewSimApp(
app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName,
)

app.FeeGrantKeeper = feegrant.NewKeeper(appCodec, keys[feegrant.StoreKey])
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegranttypes.StoreKey])
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath)

// register the staking hooks
@@ -374,7 +376,7 @@ func NewSimApp(
app.mm.SetOrderInitGenesis(
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName,
slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName,
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, feegrant.ModuleName,
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, feegranttypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
66 changes: 0 additions & 66 deletions x/feegrant/alias.go

This file was deleted.

11 changes: 6 additions & 5 deletions x/feegrant/genesis.go
Original file line number Diff line number Diff line change
@@ -2,11 +2,12 @@ package feegrant

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
"github.com/cosmos/cosmos-sdk/x/feegrant/types"
)

// GenesisState contains a set of fee allowances, persisted from the store
type GenesisState []FeeAllowanceGrant
type GenesisState []types.FeeAllowanceGrant

// ValidateBasic ensures all grants in the genesis state are valid
func (g GenesisState) ValidateBasic() error {
@@ -20,7 +21,7 @@ func (g GenesisState) ValidateBasic() error {
}

// InitGenesis will initialize the keeper from a *previously validated* GenesisState
func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState) {
func InitGenesis(ctx sdk.Context, k keeper.Keeper, data *types.GenesisState) {
for _, f := range data.FeeAllowances {
k.GrantFeeAllowance(ctx, f.Granter, f.Grantee, f.GetFeeGrant())
}
@@ -33,11 +34,11 @@ func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState) {
// for export, like if they have expiry at 5000 and current is 4000, they export with
// expiry of 1000. Every FeeAllowance has a method `PrepareForExport` that allows
// them to perform any changes needed prior to export.
func ExportGenesis(ctx sdk.Context, k Keeper) (*types.GenesisState, error) {
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) (*types.GenesisState, error) {
time, height := ctx.BlockTime(), ctx.BlockHeight()
var grants []FeeAllowanceGrant
var grants []types.FeeAllowanceGrant

err := k.IterateAllFeeAllowances(ctx, func(grant FeeAllowanceGrant) bool {
err := k.IterateAllFeeAllowances(ctx, func(grant types.FeeAllowanceGrant) bool {
grants = append(grants, grant.PrepareForExport(time, height))
return false
})
9 changes: 5 additions & 4 deletions x/feegrant/handler.go
Original file line number Diff line number Diff line change
@@ -4,24 +4,25 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
"github.com/cosmos/cosmos-sdk/x/feegrant/types"
)

func NewHandler(k Keeper) sdk.Handler {
func NewHandler(k keeper.Keeper) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
msgServer := keeper.NewMsgServerImpl(k)

switch msg := msg.(type) {
case *MsgGrantFeeAllowance:
case *types.MsgGrantFeeAllowance:
res, err := msgServer.GrantFeeAllowance(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)

case *MsgRevokeFeeAllowance:
case *types.MsgRevokeFeeAllowance:
res, err := msgServer.RevokeFeeAllowance(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)

default:
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", ModuleName, msg)
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg)
}
}
}
10 changes: 5 additions & 5 deletions x/feegrant/module.go
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ type AppModuleBasic struct{}

// Name returns the feegrant module's name.
func (AppModuleBasic) Name() string {
return ModuleName
return types.ModuleName
}

// RegisterServices registers a gRPC query service to respond to the
@@ -117,11 +117,11 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command {
// AppModule implements an application module for the feegrant module.
type AppModule struct {
AppModuleBasic
keeper Keeper
keeper keeper.Keeper
}

// NewAppModule creates a new AppModule object
func NewAppModule(keeper Keeper) AppModule {
func NewAppModule(keeper keeper.Keeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{},
keeper: keeper,
@@ -130,7 +130,7 @@ func NewAppModule(keeper Keeper) AppModule {

// Name returns the feegrant module's name.
func (AppModule) Name() string {
return ModuleName
return types.ModuleName
}

// RegisterInvariants registers the feegrant module invariants.
@@ -148,7 +148,7 @@ func (am AppModule) NewHandler() sdk.Handler {

// QuerierRoute returns the feegrant module's querier route name.
func (AppModule) QuerierRoute() string {
return QuerierRoute
return types.QuerierRoute
}

// // NewQuerierHandler returns the feegrant module sdk.Querier.