Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Dec 1, 2023
1 parent c0885c8 commit df3259d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions x/uibc/module/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ func BeginBlock(ctx sdk.Context, k quota.Keeper) {
logger := ctx.Logger().With("module", "uibc")
quotaExpires, err := k.GetExpire()
if err != nil {
logger.Error("can't get quota exipre", "error", err)
logger.Error("can't get quota expire", "error", err)
return
}

// reset quotas
if quotaExpires == nil || quotaExpires.Before(ctx.BlockTime()) {
if err = k.ResetAllQuotas(); err != nil {
logger.Error("can't get quota exipre", "error", err)
logger.Error("can't get quota expire", "error", err)
} else {
logger.Info("IBC Quota Reset")
ctx.EventManager().EmitEvent(
Expand Down
4 changes: 2 additions & 2 deletions x/uibc/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"github.com/umee-network/umee/v6/util"
ibctransfer "github.com/umee-network/umee/v6/x/uibc"
"github.com/umee-network/umee/v6/x/uibc"
"github.com/umee-network/umee/v6/x/uibc/client/cli"
"github.com/umee-network/umee/v6/x/uibc/quota"
)
Expand All @@ -35,7 +35,7 @@ func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic {

// DefaultGenesis implements module.AppModuleBasic
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(ibctransfer.DefaultGenesisState())
return cdc.MustMarshalJSON(uibc.DefaultGenesisState())
}

// GetQueryCmd implements module.AppModuleBasic
Expand Down
4 changes: 1 addition & 3 deletions x/uibc/uics20/ibc_module.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package uics20

import (
"encoding/json"

"cosmossdk.io/errors"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
Expand Down Expand Up @@ -89,7 +87,7 @@ func (im ICS20Module) deserializeFTData(packet channeltypes.Packet) (d transfert

func ValidateReceiverAddress(packet channeltypes.Packet) error {
var packetData transfertypes.FungibleTokenPacketData
if err := json.Unmarshal(packet.GetData(), &packetData); err != nil {
if err := im.json.Unmarshal(packet.GetData(), &packetData); err != nil {
return err
}
if len(packetData.Receiver) >= 4096 {
Expand Down

0 comments on commit df3259d

Please sign in to comment.