Skip to content

Commit

Permalink
chore: add private send transfer function
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed Sep 28, 2022
1 parent 0d63964 commit b86264f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.
return nil, err
}

if err := k.SendTransfer(
if err := k.sendTransfer(
ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp,
); err != nil {
return nil, err
Expand Down
23 changes: 23 additions & 0 deletions modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ func (k Keeper) SendTransfer(
receiver string,
timeoutHeight clienttypes.Height,
timeoutTimestamp uint64,
) error {
return k.sendTransfer(
ctx,
sourcePort,
sourceChannel,
token,
sender,
receiver,
timeoutHeight,
timeoutTimestamp,
)
}

// sendTransfer handles transfer sending logic.
func (k Keeper) sendTransfer(
ctx sdk.Context,
sourcePort,
sourceChannel string,
token sdk.Coin,
sender sdk.AccAddress,
receiver string,
timeoutHeight clienttypes.Height,
timeoutTimestamp uint64,
) error {
if !k.GetSendEnabled(ctx) {
return types.ErrSendDisabled
Expand Down

0 comments on commit b86264f

Please sign in to comment.