Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
183 lines
3.3 KiB
Go
183 lines
3.3 KiB
Go
//go:build !relayer
|
|
|
|
package ibc_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
envtest "github.com/ignite/cli/v29/integration"
|
|
)
|
|
|
|
func TestCreateModuleWithIBC(t *testing.T) {
|
|
var (
|
|
env = envtest.New(t)
|
|
app = env.ScaffoldApp("github.com/test/blogibc")
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module",
|
|
false,
|
|
"module", "foo", "--ibc", "--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module with custom path",
|
|
false,
|
|
"module",
|
|
"appPath",
|
|
"--ibc",
|
|
"--require-registration",
|
|
"--path",
|
|
"./blogibc",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a type in an IBC module",
|
|
false,
|
|
"list", "user", "email", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module with an ordered channel",
|
|
false,
|
|
"module",
|
|
"orderedfoo",
|
|
"--ibc",
|
|
"--ordering",
|
|
"ordered",
|
|
"--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module with an unordered channel",
|
|
false,
|
|
"module",
|
|
"unorderedfoo",
|
|
"--ibc",
|
|
"--ordering",
|
|
"unordered",
|
|
"--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a non IBC module",
|
|
false,
|
|
"module", "non_ibc", "--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module with dependencies",
|
|
false,
|
|
"module",
|
|
"with_dep",
|
|
"--ibc",
|
|
"--dep",
|
|
"auth,bank,staking,slashing",
|
|
"--require-registration",
|
|
)
|
|
|
|
app.EnsureSteady()
|
|
}
|
|
|
|
func TestCreateIBCPacket(t *testing.T) {
|
|
var (
|
|
env = envtest.New(t)
|
|
app = env.ScaffoldApp("github.com/test/blogibcb")
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create an IBC module",
|
|
false,
|
|
"module", "foo", "--ibc", "--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a packet",
|
|
false,
|
|
"packet",
|
|
"bar",
|
|
"text",
|
|
"texts:strings",
|
|
"--module",
|
|
"foo",
|
|
"--ack",
|
|
"foo:string,bar:int,baz:bool",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a packet with no module specified",
|
|
true,
|
|
"packet", "bar", "text",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a packet in a non existent module",
|
|
true,
|
|
"packet", "bar", "text", "--module", "nomodule",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating an existing packet",
|
|
true,
|
|
"packet", "bar", "post", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a packet with custom type fields",
|
|
false,
|
|
"packet",
|
|
"ticket",
|
|
"numInt:int",
|
|
"numsInt:array.int",
|
|
"numsIntAlias:ints",
|
|
"numUint:uint",
|
|
"numsUint:array.uint",
|
|
"numsUintAlias:uints",
|
|
"textString:string",
|
|
"textStrings:array.string",
|
|
"textStringsAlias:strings",
|
|
"victory:bool",
|
|
"textCoin:coin",
|
|
"textCoins:array.coin",
|
|
"--module",
|
|
"foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a custom field type",
|
|
false,
|
|
"type", "custom-type", "customField:uint", "textCoinsAlias:coins", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a packet with a custom field type",
|
|
false, "packet", "foo-baz", "customField:CustomType", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a packet with invalid custom array field type",
|
|
true, "packet", "foo-baz-invalid-array", "customFields:array.UnknownType", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a packet with no send message",
|
|
false, "packet", "nomessage", "foo", "--no-message", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a packet with no field",
|
|
false, "packet", "empty", "--module", "foo",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"create a non-IBC module",
|
|
false, "module", "bar", "--require-registration",
|
|
)
|
|
|
|
app.Scaffold(
|
|
"should prevent creating a packet in a non IBC module",
|
|
true, "packet", "foo", "text", "--module", "bar",
|
|
)
|
|
|
|
app.EnsureSteady()
|
|
}
|