package helpers import ( "context" "strings" "testing" "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/stretchr/testify/require" ) func GetIBCHooksUserAddress( t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, channel, uaddr string, ) string { // persistenceCore q ibchooks wasm-sender channel-0 "persistence1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl" --node http://localhost:26657 chainNode := chain.Nodes()[0] stdout, _, err := chainNode.ExecQuery(ctx, "ibchooks", "wasm-sender", channel, uaddr) require.NoError(t, err) return strings.TrimSpace(string(stdout)) } func GetIBCHookTotalFunds(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, contract string, uaddr string) GetTotalFundsResponse { var res GetTotalFundsResponse err := chain.QueryContract(ctx, contract, QueryMsg{GetTotalFunds: &GetTotalFundsQuery{Addr: uaddr}}, &res) require.NoError(t, err) return res } func GetIBCHookCount(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, contract string, uaddr string) GetCountResponse { var res GetCountResponse err := chain.QueryContract(ctx, contract, QueryMsg{GetCount: &GetCountQuery{Addr: uaddr}}, &res) require.NoError(t, err) return res }