Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thank you for your response. I'm trying to use UML concepts to make blockchain smart contracts as a finite state machine. UML defines events as triggers for state transitions. For a state machine in blockchain events are caused by transactions. So events happen and trigger state transitions. A State Machine should be able to validate transations in consensus code (disable a transaction if it is not allowed in the current state) But if transactions are events, not transitions, seems guards do not help? As guards are for state transitions, not events. Commented Nov 10, 2019 at 12:55
  • @xdimy I updated my answer to emphasise the distinction between the request (event) and the transaction (action). I also show how an error action could be generated. Commented Nov 10, 2019 at 16:18
  • Thank you, for this case we might consider transactions in mempool as spend_requests and in UML terms they could be defined as 'message events' (more specifically like 'Call for Validation'). That way, we can use guards to validate transactions. Commented Nov 10, 2019 at 19:32