Skip to content

Commit

Permalink
nit: ics29 comments (#910)
Browse files Browse the repository at this point in the history
* fix: comments

* Update modules/apps/29-fee/keeper/escrow.go

Co-authored-by: Aditya <[email protected]>
  • Loading branch information
seantking and AdityaSripal authored Feb 15, 2022
1 parent 6f19978 commit ea2984b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions modules/apps/29-fee/keeper/escrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func (k Keeper) DistributePacketFees(ctx sdk.Context, refundAcc, forwardRelayer

// DistributePacketsFeesTimeout pays the timeout fee for a given packetId while refunding the acknowledgement fee & receive fee to the refund account associated with the Fee
func (k Keeper) DistributePacketFeesOnTimeout(ctx sdk.Context, refundAcc string, timeoutRelayer sdk.AccAddress, feeInEscrow types.IdentifiedPacketFee) {
// check if refundAcc address works
refundAddr, err := sdk.AccAddressFromBech32(refundAcc)
if err != nil {
panic(fmt.Sprintf("could not parse refundAcc %s to sdk.AccAddress", refundAcc))
Expand All @@ -90,7 +89,7 @@ func (k Keeper) DistributePacketFeesOnTimeout(ctx sdk.Context, refundAcc string,
// If the distribution fails for any reason (such as the receiving address being blocked),
// the state changes will be discarded.
func (k Keeper) distributeFee(ctx sdk.Context, receiver sdk.AccAddress, fee sdk.Coins) {
// cache context before trying to send to reverse relayer
// cache context before trying to distribute fees
cacheCtx, writeFn := ctx.CacheContext()

err := k.bankKeeper.SendCoinsFromModuleToAccount(cacheCtx, types.ModuleName, receiver, fee)
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/29-fee/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"
)

// InitGenesis
// InitGenesis initializes the fee middleware application state from a provided genesis state
func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) {
for _, fee := range state.IdentifiedFees {
k.SetFeeInEscrow(ctx, fee)
Expand All @@ -25,7 +25,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) {
}
}

// ExportGenesis
// ExportGenesis returns the fee middleware application exported genesis
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
return &types.GenesisState{
IdentifiedFees: k.GetAllIdentifiedPacketFees(ctx),
Expand Down
3 changes: 1 addition & 2 deletions modules/apps/29-fee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier {
// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
// types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

// InitGenesis performs genesis initialization for the ibc-29-fee module. It returns
Expand Down Expand Up @@ -155,7 +155,6 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V

// GenerateGenesisState creates a randomized GenState of the 29-fee module.
func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
// simulation.RandomizedGenState(simState)
}

// ProposalContents doesn't return any content functions for governance proposals.
Expand Down

0 comments on commit ea2984b

Please sign in to comment.