Skip to content

Commit

Permalink
Add dex contract ACL type (#239)
Browse files Browse the repository at this point in the history
## Describe your changes and provide context
Add new constant type for ContractInfoV2 in dex module

## Testing performed to validate your change
  • Loading branch information
codchen authored May 12, 2023
1 parent d9bc47e commit 4192d17
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 88 deletions.
2 changes: 2 additions & 0 deletions proto/cosmos/accesscontrol/constants.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ enum ResourceType {
KV_DEX_MEM_ORDER = 87;
KV_DEX_MEM_CANCEL = 88;
KV_DEX_MEM_DEPOSIT = 89;

KV_DEX_CONTRACT = 90; // child of KV_DEX
}

enum WasmMessageSubtype {
Expand Down
1 change: 1 addition & 0 deletions scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ protoc_gen_gocosmos() {
}

protoc_gen_gocosmos
PATH="${PATH}:${HOME}/go/bin"

proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
Expand Down
179 changes: 91 additions & 88 deletions types/accesscontrol/constants.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions types/accesscontrol/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ var ResourceTree = map[ResourceType]TreeNode{
ResourceType_KV_DEX_PAIR_PREFIX,
ResourceType_KV_DEX_TWAP,
ResourceType_KV_DEX_PRICE,
ResourceType_KV_DEX_CONTRACT,
ResourceType_KV_DEX_SETTLEMENT_ENTRY,
ResourceType_KV_DEX_REGISTERED_PAIR,
ResourceType_KV_DEX_ORDER,
Expand All @@ -103,6 +104,7 @@ var ResourceTree = map[ResourceType]TreeNode{
ResourceType_KV_DEX_CONTRACT_LONGBOOK: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_CONTRACT_SHORTBOOK: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_ORDER_BOOK: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_CONTRACT: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_PAIR_PREFIX: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_TWAP: {ResourceType_KV_DEX, []ResourceType{}},
ResourceType_KV_DEX_PRICE: {ResourceType_KV_DEX, []ResourceType{}},
Expand Down
Loading

0 comments on commit 4192d17

Please sign in to comment.