package types_test

import (
	"fmt"

	"git.cw.tr/mukan-network/mukan-ibc/modules/apps/27-interchain-accounts/types"
	ibctesting "git.cw.tr/mukan-network/mukan-ibc/testing"
)

func (suite *TypesTestSuite) TestKeyActiveChannel() {
	key := types.KeyActiveChannel("port-id", "connection-id")
	suite.Require().Equal("activeChannel/port-id/connection-id", string(key))
}

func (suite *TypesTestSuite) TestKeyOwnerAccount() {
	key := types.KeyOwnerAccount("port-id", "connection-id")
	suite.Require().Equal("owner/port-id/connection-id", string(key))
}

func (suite *TypesTestSuite) TestKeyIsMiddlewareEnabled() {
	key := types.KeyIsMiddlewareEnabled(ibctesting.MockPort, ibctesting.FirstChannelID)
	suite.Require().Equal(fmt.Sprintf("%s/%s/%s", types.IsMiddlewareEnabledPrefix, ibctesting.MockPort, ibctesting.FirstChannelID), string(key))
}
