Proposal WriteSignBytes is JSON

This commit is contained in:
Jae Kwon
2015-04-27 20:55:28 -07:00
parent 0cb99be988
commit 5366d808ba
3 changed files with 40 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import (
"strings"
"sync"
"github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/common"
"github.com/tendermint/tendermint/merkle"
)
@ -84,6 +85,10 @@ func (psh PartSetHeader) Equals(other PartSetHeader) bool {
return psh.Total == other.Total && bytes.Equal(psh.Hash, other.Hash)
}
func (psh PartSetHeader) WriteSignBytes(w io.Writer, n *int64, err *error) {
binary.WriteTo([]byte(Fmt(`{"Hash":"%X","Total":%v}`, psh.Hash, psh.Total)), w, n, err)
}
//-------------------------------------
type PartSet struct {