Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Nov 6, 2024
1 parent 6d3de88 commit 57c69c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions x/circuit/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestAuthorizeCircuitBreakerWithPermissionValidation(t *testing.T) {
require.Error(t, err)

// grants user perms to Permissions_LEVEL_SOME_MSGS with empty LimitTypeUrls
permis := types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{"cosmos.staking.v1beta1.MsgDelegate", "/cosmos.gov.v1beta1.MsgDeposit", ""}}
permis := types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{"cosmos.staking.v1beta1.MsgDelegate", "/cosmos.gov.v1beta1.MsgDeposit", "cosmos.gov.v1beta1.MsgVote"}}
msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[4], Permissions: &permis}
_, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg)
require.NoError(t, err)
Expand All @@ -185,7 +185,7 @@ func TestAuthorizeCircuitBreakerWithPermissionValidation(t *testing.T) {
perms, err = ft.keeper.Permissions.Get(ft.ctx, add4)
require.NoError(t, err)

require.Equal(t, []string{"/cosmos.staking.v1beta1.MsgDelegate", "/cosmos.gov.v1beta1.MsgDeposit"}, perms.LimitTypeUrls)
require.Equal(t, []string{"/cosmos.staking.v1beta1.MsgDelegate", "/cosmos.gov.v1beta1.MsgDeposit", "/cosmos.gov.v1beta1.MsgVote"}, perms.LimitTypeUrls)
}

func TestTripCircuitBreaker(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions x/circuit/types/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ func (p *Permissions) Validation() error {
func MsgTypeURLValidation(urls []string) []string {
for idx, url := range urls {
if len(url) == 0 {
// remove this element
urls = append(urls[:idx], urls[idx+1:]...)
continue
}
if url[0] != '/' {
Expand Down

0 comments on commit 57c69c2

Please sign in to comment.