Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignite
GitHub Repository: ignite/cli
Path: blob/main/integration/params/cmd_params_test.go
1007 views
1
//go:build !relayer
2
3
package params_test
4
5
import (
6
"context"
7
"testing"
8
9
envtest "github.com/ignite/cli/v29/integration"
10
)
11
12
func TestCreateModuleParameters(t *testing.T) {
13
var (
14
name = "mars"
15
namespace = "github.com/test/" + name
16
17
env = envtest.New(t)
18
app = env.ScaffoldApp(namespace)
19
servers = app.RandomizeServerPorts()
20
)
21
22
app.Scaffold(
23
"create a new module with parameter",
24
false,
25
"module",
26
"foo",
27
"--params",
28
"bla,baz:uint,bar:bool",
29
"--require-registration",
30
)
31
32
app.Scaffold(
33
"should prevent creating parameter field that already exist",
34
true,
35
"params",
36
"bla",
37
"buu:uint",
38
"--module",
39
"foo",
40
)
41
42
app.Scaffold(
43
"create a new module parameters in the foo module",
44
false,
45
"params",
46
"bol",
47
"buu:uint",
48
"plk:bool",
49
"--module",
50
"foo",
51
)
52
53
app.Scaffold(
54
"create a new module parameters in the mars module",
55
false,
56
"params",
57
"foo",
58
"bar:uint",
59
"baz:bool",
60
)
61
62
app.EnsureSteady()
63
64
ctx, cancel := context.WithCancel(env.Ctx())
65
defer cancel()
66
67
go func() {
68
app.MustServe(ctx)
69
}()
70
71
app.WaitChainUp(ctx, servers.API)
72
}
73
74