-
Notifications
You must be signed in to change notification settings - Fork 144
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
Encoding library and standardizing usage #48
Conversation
I'd say hold off on this PR until we get CBOR in. Based on how serde looks like its used, we the Cbor traits that your implementing. You simply need to derive |
The reason I state that these specific implementations will be needed is because the data structures need to have very specific cbor encodings and not just one that is generic. I agree that this should probably be finalized since it isn't clear the cbor encoded formats and how the library will be used |
It became clear today that serde will not be the soloution. Since we need to match the IPLD data model, it seems sensible to implement traits to be able to explicitly handle encoding. |
Cleaned up usage and only included things I assume will be needed. Trait name or function signature may change, but this is easy to change in the future. The other components will be reusable and blake2 hashing will be needed outside of the context of multihash. PR is ready to review |
@@ -235,21 +231,5 @@ pub fn validate_checksum(ingest: Vec<u8>, expect: Vec<u8>) -> bool { | |||
|
|||
/// Returns an address hash for given data | |||
fn address_hash(ingest: Vec<u8>) -> Vec<u8> { |
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.
What is this actually used for?
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.
to create the 20 byte hash used as the address for secp256k1 and actor protocols
@ec2 @GregTheGreek @ansermino bork usage example with address if it makes this easier to review: austin/encoding...austin/addresscbor |
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.
LGTM
If this doesn't get reviewed by the time I implement the generic cbor encoding and utility functions, I will include in this PR. Opening to allow this to be used as soon as necessary and not have to rewrite.