Skip to content

Commit

Permalink
fix: system test
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Dec 18, 2024
1 parent e805791 commit bc53fd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
14 changes: 5 additions & 9 deletions tests/systemtests/circuit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,40 +101,36 @@ func TestCircuitCommands(t *testing.T) {
authorizeTestCases := []struct {
name string
address string
level int
level string
limtTypeURLs []string
expPermission string
}{
{
"set new super admin",
superAdmin2,
3,
"super-admin",
[]string{},
"LEVEL_SUPER_ADMIN",
},
{
"set all msgs level to address",
allMsgsAcc,
2,
"all-msgs",
[]string{},
"LEVEL_ALL_MSGS",
},
{
"set some msgs level to address",
someMsgsAcc,
1,
"some-msgs",
someMsgs,
"LEVEL_SOME_MSGS",
},
}

for _, tc := range authorizeTestCases {
t.Run(tc.name, func(t *testing.T) {
permissionJSON := fmt.Sprintf(`{"level":%d,"limit_type_urls":[]}`, tc.level)
if len(tc.limtTypeURLs) != 0 {
permissionJSON = fmt.Sprintf(`{"level":%d,"limit_type_urls":["%s"]}`, tc.level, strings.Join(tc.limtTypeURLs[:], `","`))
}
rsp = cli.RunAndWait("tx", "circuit", "authorize", tc.address, permissionJSON, "--from="+superAdmin)
rsp = cli.RunAndWait("tx", "circuit", "authorize", tc.address, tc.level, strings.Join(tc.limtTypeURLs[:], `,`), "--from="+superAdmin)
systest.RequireTxSuccess(t, rsp)

// query account permissions
Expand Down
1 change: 0 additions & 1 deletion x/circuit/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Example: fmt.Sprintf(`%s tx circuit authorize [address] super-admin "/cosmos.bank.v1beta1.MsgSend,/cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "grantee"},
{ProtoField: "permissions"},
{ProtoField: "permissions.level"},
{ProtoField: "permissions.limit_type_urls"},
},
Expand Down

0 comments on commit bc53fd1

Please sign in to comment.