Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed May 23, 2024
1 parent d5637a1 commit 1ba80f0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions custom/ibc-transfer/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"context"
"encoding/json"

"github.com/cosmos/cosmos-sdk/codec"
ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
Expand All @@ -13,6 +14,7 @@ import (
"github.com/cosmos/ibc-go/v7/modules/core/exported"
custombankkeeper "github.com/notional-labs/composable/v6/custom/bank/keeper"
ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/keeper"
ibctransfermiddlewaretypes "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types"
)

type Keeper struct {
Expand Down Expand Up @@ -54,3 +56,26 @@ func NewKeeper(
func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
return k.Keeper.Transfer(goCtx, msg)
}

func GetPriority(jsonString string) *string {
var data map[string]interface{}
if err := json.Unmarshal([]byte(jsonString), &data); err != nil {
return nil
}

priority, ok := data["priority"].(string)
if !ok {
return nil
}

return &priority
}

func findPriority(priorities []*ibctransfermiddlewaretypes.TxPriorityFee, priority string) *ibctransfermiddlewaretypes.TxPriorityFee {
for _, p := range priorities {
if p.Priority == priority {
return p
}
}
return nil
}

0 comments on commit 1ba80f0

Please sign in to comment.