forked from sei-protocol/sei-tendermint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Wasm contract to specify fine grained dependency (sei-protocol#73)
## Describe your changes and provide context Allow Wasm contract owner to specify a selector when registering wasm dependencies so that fine-grained resource ID can be populated during runtime. For example, if a contract has an execute endpoint `send` whose payload involves a `destination` address which will result in the contract writing to a corresponding KV entry in bank store, the owner can specify the dependency as: ```json { ... "access_ops": [ ... { "operation": { "access_type": "WRITE", "resource_type": "KV_BANK", "identifier_template": "balances/%s" }, "selector_type": "JQ", "selector": ".send.destination" } ... ] } ``` When someone sends an execute message `{"send":{"destination":"bob"}}` to this contract, the identifier would evaluate to `balances/bob` during runtime. ## Testing performed to validate your change unit test
- Loading branch information
Showing
12 changed files
with
505 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.