Skip to content

Commit

Permalink
[1834]: If no force transfer, and coming from a marker, make sure the…
Browse files Browse the repository at this point in the history
… admin has withdraw on that marker. Unit tests on the TransferCoin function.
  • Loading branch information
SpicyLemon committed Feb 8, 2024
1 parent 38242bc commit 0edadca
Show file tree
Hide file tree
Showing 4 changed files with 689 additions and 3 deletions.
17 changes: 16 additions & 1 deletion x/marker/keeper/export_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package keeper

import sdk "github.com/cosmos/cosmos-sdk/types"
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/provenance-io/provenance/x/marker/types"
)

// This file is available only to unit tests and exposes private things
// so that they can be used in unit tests.
Expand All @@ -23,3 +26,15 @@ func (k Keeper) GetIbcTransferModuleAddr() sdk.AccAddress {
func (k Keeper) CanForceTransferFrom(ctx sdk.Context, from sdk.AccAddress) bool {
return k.canForceTransferFrom(ctx, from)
}

// WithBankKeeper is a TEST ONLY func that returns a copy of this marker keeper but with the provided bank keeper instead.
func (k Keeper) WithBankKeeper(bankKeeper types.BankKeeper) Keeper {
k.bankKeeper = bankKeeper
return k
}

// WithAuthzKeeper is a TEST ONLY func that returns a copy of this marker keeper but with the provided authz keeper instead.
func (k Keeper) WithAuthzKeeper(authzKeeper types.AuthzKeeper) Keeper {
k.authzKeeper = authzKeeper
return k
}
Loading

0 comments on commit 0edadca

Please sign in to comment.