github.com/Finschia/finschia-sdk@v0.48.1/x/foundation/keeper/exported.go (about) 1 package keeper 2 3 import ( 4 "github.com/Finschia/finschia-sdk/baseapp" 5 "github.com/Finschia/finschia-sdk/codec" 6 sdk "github.com/Finschia/finschia-sdk/types" 7 "github.com/Finschia/finschia-sdk/x/foundation" 8 "github.com/Finschia/finschia-sdk/x/foundation/keeper/internal" 9 govtypes "github.com/Finschia/finschia-sdk/x/gov/types" 10 paramtypes "github.com/Finschia/finschia-sdk/x/params/types" 11 ) 12 13 type Keeper interface { 14 GetAuthority() string 15 Accept(ctx sdk.Context, grantee sdk.AccAddress, msg sdk.Msg) error 16 17 InitGenesis(ctx sdk.Context, gs *foundation.GenesisState) error 18 ExportGenesis(ctx sdk.Context) *foundation.GenesisState 19 } 20 21 type keeper struct { 22 impl internal.Keeper 23 } 24 25 func NewKeeper( 26 cdc codec.Codec, 27 key sdk.StoreKey, 28 router *baseapp.MsgServiceRouter, 29 authKeeper foundation.AuthKeeper, 30 bankKeeper foundation.BankKeeper, 31 feeCollectorName string, 32 config foundation.Config, 33 authority string, 34 paramspace paramtypes.Subspace, 35 ) Keeper { 36 return &keeper{ 37 impl: internal.NewKeeper( 38 cdc, 39 key, 40 router, 41 authKeeper, 42 bankKeeper, 43 feeCollectorName, 44 config, 45 authority, 46 paramspace, 47 ), 48 } 49 } 50 51 // GetAuthority returns the x/foundation module's authority. 52 func (k keeper) GetAuthority() string { 53 return k.impl.GetAuthority() 54 } 55 56 func (k keeper) Accept(ctx sdk.Context, grantee sdk.AccAddress, msg sdk.Msg) error { 57 return k.impl.Accept(ctx, grantee, msg) 58 } 59 60 func (k keeper) InitGenesis(ctx sdk.Context, gs *foundation.GenesisState) error { 61 return k.impl.InitGenesis(ctx, gs) 62 } 63 64 func (k keeper) ExportGenesis(ctx sdk.Context) *foundation.GenesisState { 65 return k.impl.ExportGenesis(ctx) 66 } 67 68 func NewMsgServer(k Keeper) foundation.MsgServer { 69 impl := k.(*keeper).impl 70 return internal.NewMsgServer(impl) 71 } 72 73 func NewQueryServer(k Keeper) foundation.QueryServer { 74 impl := k.(*keeper).impl 75 return internal.NewQueryServer(impl) 76 } 77 78 func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) { 79 impl := k.(*keeper).impl 80 internal.RegisterInvariants(ir, impl) 81 } 82 83 func BeginBlocker(ctx sdk.Context, k Keeper) { 84 impl := k.(*keeper).impl 85 internal.BeginBlocker(ctx, impl) 86 } 87 88 func EndBlocker(ctx sdk.Context, k Keeper) { 89 impl := k.(*keeper).impl 90 internal.EndBlocker(ctx, impl) 91 } 92 93 func NewFoundationProposalsHandler(k Keeper) govtypes.Handler { 94 impl := k.(*keeper).impl 95 return internal.NewFoundationProposalsHandler(impl) 96 } 97 98 type Migrator = internal.Migrator 99 100 func NewMigrator(k Keeper) Migrator { 101 impl := k.(*keeper).impl 102 return internal.NewMigrator(impl) 103 }