sign bytes w struct literals

This commit is contained in:
zachary balder
2016-11-16 17:20:44 -06:00
committed by Ethan Buchman
parent ed42f70248
commit da8b043612
3 changed files with 78 additions and 19 deletions

View File

@ -74,7 +74,15 @@ func (psh PartSetHeader) Equals(other PartSetHeader) bool {
}
func (psh PartSetHeader) WriteSignBytes(w io.Writer, n *int, err *error) {
wire.WriteTo([]byte(Fmt(`{"hash":"%X","total":%v}`, psh.Hash, psh.Total)), w, n, err)
wire.WriteJSON(
struct {
Hash []byte `json:"hash"`
Total int `json:"total"`
}{
psh.Hash,
psh.Total,
},
w, n, err)
}
//-------------------------------------