[messages] add enum for Order to simplify adding new order types #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, there were transfer orders (to transfer funds), and confirmation orders (to commit an order that has gathered
signatures from a quorum of authorities. This PR converts the first kind of orders to an enum, which will make it easy to
add new kinds of orders (publish Move module, invoke smart contract function, create objects, ...).
Every order must know its sender, sequence number, and object ID. In time, this will need to be generalized to multiple objects, each with its own sequence number (see #8).
In addition, several usages of
Order
assume that there is a single recipient address (see: all the spots outside messages.rs where we need to pattern match on theOrderKind
). These will also need to be refactored in time--some orders will have multiple recipients, some will have none, and in some cases the recipients may not be known prior to executing the order.