-
Notifications
You must be signed in to change notification settings - Fork 161
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 Message type and vm packages #79
Conversation
} | ||
|
||
impl Cbor for SignedMessage { | ||
fn unmarshal_cbor(_bz: &[u8]) -> Result<Self, EncodingError> { |
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.
BTW, I dont know if it suits this usecase exactly, but there is an unimplemented!
macro.
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.
yeah, I'm just keeping it as an error so it is recoverable and doesn't crash everything when something is attempted to be encoded/decoded
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.
Also, encoding/decoding shouldn't cause a panic, parent function should deal with it
@ec2 @dutterbutter moved the CodeID type to the actor crate |
@ansermino @GregTheGreek pls review if you can, holding up Dustin and a few of my PRs |
…hainSafe#79) * feat(bellman): use bellman lib which uses env to disable/enable GPU * feat(addpiece): update add_piece call site to conform to new API * feat(addpiece): update add_piece call site to conform to new API
Edit: Refactored the vm components into crates also in this PR to get those changes in ASAP. This will be important to do now to not have conflicts and an extremely complicated refactor later. If you look at the structure, the vm crate is primarily used for the vm types currently and the logic and functionality and types used commonly in other packages (message, address) into their own package.
Message refactor info:
After building out the System actors it became apparent that there needs to be some slight changes to the message types and there will probably be a need to iterate over ambiguously signed and unsigned messages.
This moves the Message struct to UnsignedMessage and adds a Message trait which both signed and unsigned messages will implement. Ideally, you would be able to iterate over signed messages and unsigned messages seperately, but if you need to iterate over both types at once (for readability and reduce redundancy) you can just iterate over a pointer to this Message trait implementation.