This commit is contained in:
Jae Kwon
2014-07-01 14:50:24 -07:00
parent fa07748d23
commit c40fc65e6b
41 changed files with 3176 additions and 2938 deletions

View File

@ -1,8 +1,8 @@
package blocks
import (
. "github.com/tendermint/tendermint/binary"
"io"
. "github.com/tendermint/tendermint/binary"
"io"
)
/*
@ -11,22 +11,22 @@ Typically only the signature is passed around, as the hash & height are implied.
*/
type Vote struct {
Height UInt64
BlockHash ByteSlice
Signature
Height UInt64
BlockHash ByteSlice
Signature
}
func ReadVote(r io.Reader) Vote {
return Vote{
Height: ReadUInt64(r),
BlockHash: ReadByteSlice(r),
Signature: ReadSignature(r),
}
return Vote{
Height: ReadUInt64(r),
BlockHash: ReadByteSlice(r),
Signature: ReadSignature(r),
}
}
func (self Vote) WriteTo(w io.Writer) (n int64, err error) {
n, err = WriteOnto(self.Height, w, n, err)
n, err = WriteOnto(self.BlockHash, w, n, err)
n, err = WriteOnto(self.Signature, w, n, err)
return
n, err = WriteOnto(self.Height, w, n, err)
n, err = WriteOnto(self.BlockHash, w, n, err)
n, err = WriteOnto(self.Signature, w, n, err)
return
}