Skip to content
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

Merged
merged 6 commits into from
May 22, 2017
Merged

Message layer #39

merged 6 commits into from
May 22, 2017

Conversation

jordanschalm
Copy link
Member

No description provided.

jordanschalm and others added 4 commits May 20, 2017 14:24
* 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
@coveralls
Copy link

Coverage Status

Coverage increased (+30.1%) to 70.917% when pulling 3c898b2 on 30-msg-layer into 156dd85 on 17-p2p-scaling.

Copy link
Member

@bfbachmann bfbachmann left a 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())
}
Copy link
Member

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.
Copy link
Member

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
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better!

@bfbachmann bfbachmann merged commit 5b2f674 into 17-p2p-scaling May 22, 2017
@jordanschalm jordanschalm deleted the 30-msg-layer branch June 2, 2017 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants