-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem:
query nft owner
returns error when user has NFTs transferr…
…ed over IBC (#903) Solution: Fixed denomID and tokenID splitting logic when denom has `ibc`. * Fix lint errors
- Loading branch information
1 parent
0192445
commit 49976e2
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package types_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/crypto-org-chain/chain-main/v4/x/nft/types" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestSplitKeyDenomWithoutIBC(t *testing.T) { | ||
keyDenom := []byte("testdenomid/testtokenid") | ||
|
||
// nolint: govet | ||
denomID, tokenID, err := types.SplitKeyDenom(keyDenom) | ||
|
||
require.NoError(t, err) | ||
require.Equal(t, "testdenomid", denomID) | ||
require.Equal(t, "testtokenid", tokenID) | ||
} | ||
|
||
func TestSplitKeyDenomWithIBC(t *testing.T) { | ||
keyDenom := []byte("ibc/testdenomid/testtokenid") | ||
|
||
// nolint: govet | ||
denomID, tokenID, err := types.SplitKeyDenom(keyDenom) | ||
|
||
require.NoError(t, err) | ||
require.Equal(t, "ibc/testdenomid", denomID) | ||
require.Equal(t, "testtokenid", tokenID) | ||
} |