prettyprint block, unified state hash, test block mutation.

This commit is contained in:
Jae Kwon
2014-10-13 20:07:26 -07:00
parent 810aeb7bcb
commit c8f996f345
9 changed files with 316 additions and 141 deletions

View File

@ -1,8 +1,10 @@
package blocks
import (
. "github.com/tendermint/tendermint/binary"
"fmt"
"io"
. "github.com/tendermint/tendermint/binary"
)
type Signable interface {
@ -35,6 +37,12 @@ func (sig Signature) WriteTo(w io.Writer) (n int64, err error) {
return
}
func (sig Signature) String() string {
return fmt.Sprintf("Signature{%v:%X}", sig.SignerId, sig.Bytes)
}
//-------------------------------------
func ReadSignatures(r io.Reader, n *int64, err *error) (sigs []Signature) {
length := ReadUInt32(r, n, err)
for i := uint32(0); i < length; i++ {