Skip to content

Commit

Permalink
Add Contract References as a separate struct from Access ops in Wasm …
Browse files Browse the repository at this point in the history
…Dep Mappings (sei-protocol#132)

## Describe your changes and provide context
This separates the inter-contract references from normal access ops for
wasm dependencies. It introduces three types of contract references,
base, execute, and query contract references. Base contract references
are always imported, execute contract refs are imported specifically
based on the execute message name, and likewise for query contract
references. As an additional note, QUERY contract references cannot
contain non-query message types, since queries are read only workflows
for cosmwasm contracts.

## Testing performed to validate your change
Updated existing unit tests and adding more shortly
  • Loading branch information
udpatil authored Jan 12, 2023
1 parent 0e0e245 commit b4b7987
Show file tree
Hide file tree
Showing 16 changed files with 1,394 additions and 196 deletions.
19 changes: 17 additions & 2 deletions proto/cosmos/accesscontrol/accesscontrol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ message WasmAccessOperation {
string selector = 3;
}

message WasmContractReference {
string contract_address = 1;
WasmMessageSubtype message_type = 2;
string message_name = 3;
// TODO: add wasm message adapter format here
}

message WasmContractReferences {
string message_name = 1;
repeated WasmContractReference contract_references = 2;
}

message WasmAccessOperations {
string message_name = 1;
repeated WasmAccessOperation wasm_operations = 2;
Expand All @@ -35,6 +47,9 @@ message WasmDependencyMapping {
repeated WasmAccessOperation base_access_ops = 1;
repeated WasmAccessOperations query_access_ops = 2;
repeated WasmAccessOperations execute_access_ops = 3;
string reset_reason = 4;
string contract_address = 5;
repeated WasmContractReference base_contract_references = 4;
repeated WasmContractReferences query_contract_references = 5;
repeated WasmContractReferences execute_contract_references = 6;
string reset_reason = 7;
string contract_address = 8;
}
1 change: 1 addition & 0 deletions snapshots/types/snapshot.pb.go

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

9 changes: 9 additions & 0 deletions testutil/testdata/unknonwnproto.pb.go

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

Loading

0 comments on commit b4b7987

Please sign in to comment.