-
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!: rename wasm to smart contract #4810
Conversation
Executable::Instructions(instructions) => tx_builder.with_instructions(instructions), | ||
Executable::Wasm(wasm) => tx_builder.with_wasm(wasm), | ||
Executable::SmartContract(smart_contract) => { |
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.
Imo what corresponds to smartcontracts is triggers in Iroha, and the executable part of a trigger (and a transaction) can be Wasm or ISIs. So I don't think "smartcontract" is a good candidate to rename "wasm"
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.
While working on #4850, I noticed that Iroha has both triggers and smart contracts, at least we have two separate macros for defining the entry point. Not sure what the difference is.
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.
Ok, so smart contracts only have an owner, but triggers also specify the trigger id, owner and event. What happens when a trigger wasm is executed as a smart contract, and vice versa?
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.
While working on #4850, I noticed that Iroha has both triggers and smart contracts, at least we have two separate macros for defining the entry point. Not sure what the difference is.
how I see it.
Transaction::executable
is either aVec<Instruction>
orSmartContract
You can execute an executable withclient.submit
. This executes the instructions or the smart contract immediately on submitionAction::executable
is either aVec<Instruction>
orSmartContract
You have to first register a trigger and then invoke it withInstructionBox::Execute
. The trigger can consist ofVec<InstructinoBox
> or a be a smart contract
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.
Ok, so smart contracts only have an owner, but triggers also specify the trigger id, owner and event
no, smart contracts don't have an owner. The transaction they are part of has an owner
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.
I mean a smart contract entrypoint has an owner param, while a trigger entrypoint has that plus additional params
4db1839
to
05e47ec
Compare
Signed-off-by: Marin Veršić <[email protected]>
@s8sato has a good point. I'm closing this |
Description
The fact that we work with wasm smart contracts is a sort of implementation detail.
Let's not specify implementation details in the API.
Linked issue
Closes #{issue_number}
Benefits
If we change from wasm to some other VM, we will have a reduced effect on the API.
If we don't it is implied that we use wasm, so no harm done there
Checklist
CONTRIBUTING.md