Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gov proposal handler for acl #33

Merged
merged 4 commits into from
Oct 4, 2022
Merged

Add gov proposal handler for acl #33

merged 4 commits into from
Oct 4, 2022

Conversation

BrandonWeng
Copy link
Contributor

@BrandonWeng BrandonWeng commented Oct 4, 2022

Adding a handler for handling gov proposals from CLI in order to update the dependency mappings for access control module. Will follow up with another PR to handle deletes

Testing

Ran these commands and see that the dep mapping updated

seid tx staking delegate seivaloper1r9syjw4kdpjr8a6v38qmvn4dmmrnl869kmgsvr 59999000001341816640usei --from brando --chain-id sei-chain -b block -y --fees 2000usei

seid tx gov submit-proposal update-resource-dependency-mapping ../brando/acl-gov.json --from brando  --fees=10000000usei --gas=5000000  --chain-id sei-chain  -b block

seid tx gov deposit 1 10000000usei --chain-id sei-chain --from brando --fees=10000000usei --gas=5000000 -b block -y

seid tx gov vote 1 yes --chain-id sei-chain --from brando -b block -y --fees=10000000usei

image

x/accesscontrol/client/cli/tx.go Outdated Show resolved Hide resolved
@@ -0,0 +1,22 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


func HandleMsgUpdateResourceDependencyMappingProposal(ctx sdk.Context, k *keeper.Keeper, p *types.MsgUpdateResourceDependencyMappingProposal) error {
for _, resourceDepMapping := range p.MessageDependencyMapping {
k.SetResourceDependencyMapping(ctx, resourceDepMapping)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we do any checks over resourceDepMapping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly just the proto serialization checks -- all the fields that are not free form are ENUMs so the proto serialization should also cover those cases

@BrandonWeng BrandonWeng merged commit ad57970 into main Oct 4, 2022
@BrandonWeng BrandonWeng deleted the bweng-acl-gov-final branch October 4, 2022 22:47
BrandonWeng added a commit that referenced this pull request Oct 14, 2022
Adding a handler for handling gov proposals from CLI in order to update
the dependency mappings for access control module. Will follow up with
another PR to handle deletes

### Testing 
Ran these commands and see that the dep mapping updated
```
seid tx staking delegate seivaloper1r9syjw4kdpjr8a6v38qmvn4dmmrnl869kmgsvr 59999000001341816640usei --from brando --chain-id sei-chain -b block -y --fees 2000usei

seid tx gov submit-proposal update-resource-dependency-mapping ../brando/acl-gov.json --from brando  --fees=10000000usei --gas=5000000  --chain-id sei-chain  -b block

seid tx gov deposit 1 10000000usei --chain-id sei-chain --from brando --fees=10000000usei --gas=5000000 -b block -y

seid tx gov vote 1 yes --chain-id sei-chain --from brando -b block -y --fees=10000000usei
``` 


![image](https://user-images.githubusercontent.com/18161326/193750113-35b13a6d-d1a5-45e8-a15b-256cd2584ff7.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants