-
Notifications
You must be signed in to change notification settings - Fork 2
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
Message layer #39
Message layer #39
Conversation
* Update Marhsal functions and rewrite Wallet to be easier to use' * update travis to use glide * Override install phase in travis Add tests * add another test for blockchain encoding and refactor hashing * Fix wallet sign * small change to marshal func * Add makefile * fix getting deps for travis * oops
* Update Marhsal functions and rewrite Wallet to be easier to use' * update travis to use glide * Override install phase in travis Add tests * add another test for blockchain encoding and refactor hashing * Fix wallet sign * small change to marshal func * Add makefile * fix getting deps for travis * oops * modify the way addresses work slightly
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.
You write beautiful code
// HashSum computes the SHA256 hash of a Marshaller. | ||
func HashSum(m Marshaller) Hash { | ||
return sha256.Sum256(m.Marshal()) | ||
} |
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.
Good idea 👍
AdvertiseChunk = iota | ||
// Send information about a new transaction to another peer | ||
Transaction = iota | ||
// ResourcePeerInfo resources contain a list of peers. |
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.
Minor detail but we should update this to "... a list of peer multiaddresses" to be extra specific.
func Read(r io.Reader) (*Message, error) { | ||
var m Message | ||
err := gob.NewDecoder(r).Decode(&m) | ||
return &m, err | ||
} |
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.
Much better!
No description provided.