-
Notifications
You must be signed in to change notification settings - Fork 277
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
refactor: improve custom instruction usage #4778
Conversation
f04596c
to
8b95d9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see, this PR:
- adds a custom parameter and an empty file for custom permissions to the
executor_custom_data_model
test smartcontract - removes
Fail
instruction; replaces its uses in tests with unregistering of a non-existent domain - renames
Custom
instruction toCustomInstruction
- in addition to
Instruction
trait, addsBuiltInInstruction
, allowingInstruction
to be not sealed - in addition to
Query
trait, adds a sealedBuiltInQuery
trait, by analogy with theInstruction
trait. - makes it so that in smart contracts, only
BuiltInInstruction
andBuiltInQuery
can be executed.
My guess that the main point of it is the last change: to not allow custom instructions to be executed from wasm. While I see how it's beneficial to prevent this for executor (it's kind of recursive otherwise), I am not sure that regular smart-contracts & triggers should be prohibited from doing so...
client/tests/integration/smartcontracts/executor_custom_data_model/src/simple_isi.rs
Show resolved
Hide resolved
client/tests/integration/smartcontracts/executor_custom_data_model/src/parameters.rs
Show resolved
Hide resolved
that was an accidental leftover
this can now be expressed with a custom ISI
reverted, since as you point out it has no benefit
I tried initially but there were practical problems. Like I had to derive |
d26baec
to
648257b
Compare
Signed-off-by: Marin Veršić <[email protected]>
@DCNick3 I agree it's quite unfortunate that this doesn't work from within smart contracts, but it's still an improvement. Like was previously possible, from within smart contracts user would have to convert instruction into |
* remove `Fail` instruction * rename `Custom` to `CustomInstruction` * enable direct use of custom instructions Signed-off-by: Marin Veršić <[email protected]>
Description
Linked issue
Closes #{issue_number}
Benefits
Checklist
CONTRIBUTING.md