iroha icon indicating copy to clipboard operation
iroha copied to clipboard

triggers vs hooks

Open appetrosyan opened this issue 2 years ago • 2 comments

Minor point about language. A smart-contract is a simple "on trigger execute Executable" concept. A trigger is the mechanism that decides that something needs to run, not the thing whose main you're calling.

In other words, iroha_trigger makes me think that the trigger isn't just the event-driven system that launched the smartcontract, but that it is the smart-contract.

The old naming convention was somewhat generic, I admit, but it wasn't conceptually dissonant.

    iroha_hook::info!("Executing trigger");

or maybe

    iroha_smartcontract::info!("Executing trigger");

Personally prefer the hook name, because it's shorter and makes it clear that it acts like lisp hooks do, minus the dynamic typing.

Originally posted by @appetrosyan in https://github.com/hyperledger/iroha/pull/3813#discussion_r1298888133

appetrosyan avatar Aug 27 '23 10:08 appetrosyan

I'm not sure what is the difference between a hook and a trigger. If someone can explain we can consider renaming, although I find that trigger is quite adequate naming

mversic avatar Apr 24 '24 12:04 mversic

I don't like changing terminology without good reason.

Erigara avatar Apr 24 '24 14:04 Erigara