github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/ammswap/keeper/swap.go (about)

     1  package keeper
     2  
     3  import (
     4  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     5  	"github.com/fibonacci-chain/fbc/x/ammswap/types"
     6  )
     7  
     8  // IsTokenExist check token is exist
     9  func (k Keeper) IsTokenExist(ctx sdk.Context, token string) error {
    10  	isExist := k.tokenKeeper.TokenExist(ctx, token)
    11  	if !isExist {
    12  		return types.ErrTokenNotExist()
    13  	}
    14  
    15  	t := k.tokenKeeper.GetTokenInfo(ctx, token)
    16  	if t.Type == types.GenerateTokenType {
    17  		return types.ErrInvalidCoins()
    18  	}
    19  	return nil
    20  
    21  }