Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add initial eureka transfer tests #7901

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions modules/apps/transfer/keeper/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ func (k Keeper) GetAllDenomTraces(ctx sdk.Context) []internaltypes.DenomTrace {
return traces
}

// TokenFromCoin is a wrapper around tokenFromCoin for testing purposes.
func (k Keeper) TokenFromCoin(ctx sdk.Context, coin sdk.Coin) (types.Token, error) {
return k.tokenFromCoin(ctx, coin)
}

// UnwindHops is a wrapper around unwindHops for testing purposes.
func (k Keeper) UnwindHops(ctx sdk.Context, msg *types.MsgTransfer) (*types.MsgTransfer, error) {
return k.unwindHops(ctx, msg)
Expand Down
6 changes: 3 additions & 3 deletions modules/apps/transfer/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (k Keeper) Transfer(ctx context.Context, msg *types.MsgTransfer) (*types.Ms
}
}

tokens[i], err = k.tokenFromCoin(ctx, coin)
tokens[i], err = k.TokenFromCoin(ctx, coin)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -145,7 +145,7 @@ func (k Keeper) getUnwindHops(ctx context.Context, coins sdk.Coins) ([]types.Hop
return nil, errorsmod.Wrap(types.ErrInvalidForwarding, "coins cannot be empty")
}

token, err := k.tokenFromCoin(ctx, coins[0])
token, err := k.TokenFromCoin(ctx, coins[0])
if err != nil {
return nil, err
}
Expand All @@ -156,7 +156,7 @@ func (k Keeper) getUnwindHops(ctx context.Context, coins sdk.Coins) ([]types.Hop

unwindTrace := token.Denom.Trace
for _, coin := range coins[1:] {
token, err := k.tokenFromCoin(ctx, coin)
token, err := k.TokenFromCoin(ctx, coin)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func (k Keeper) UnescrowCoin(ctx context.Context, escrowAddress, receiver sdk.Ac
}

// tokenFromCoin constructs an IBC token given an SDK coin.
func (k Keeper) tokenFromCoin(ctx context.Context, coin sdk.Coin) (types.Token, error) {
func (k Keeper) TokenFromCoin(ctx context.Context, coin sdk.Coin) (types.Token, error) {
// if the coin does not have an IBC denom, return as is
if !strings.HasPrefix(coin.Denom, "ibc/") {
return types.Token{
Expand Down
Loading
Loading