types: update for new go-wire. WriteSignBytes -> SignBytes

This commit is contained in:
Ethan Buchman
2018-01-14 19:05:22 -05:00
parent 9cdba04fe9
commit 200787ede2
12 changed files with 67 additions and 81 deletions

View File

@ -3,7 +3,6 @@ package types
import (
"errors"
"fmt"
"io"
"time"
"github.com/tendermint/go-crypto"
@ -50,10 +49,14 @@ func (p *Proposal) String() string {
p.POLBlockID, p.Signature, CanonicalTime(p.Timestamp))
}
// WriteSignBytes writes the Proposal bytes for signing
func (p *Proposal) WriteSignBytes(chainID string, w io.Writer, n *int, err *error) {
wire.WriteJSON(CanonicalJSONOnceProposal{
// SignBytes returns the Proposal bytes for signing
func (p *Proposal) SignBytes(chainID string) []byte {
bz, err := wire.MarshalJSON(CanonicalJSONOnceProposal{
ChainID: chainID,
Proposal: CanonicalProposal(p),
}, w, n, err)
})
if err != nil {
panic(err)
}
return bz
}