Support nil pointers for Binary.

If the thing does not already have a typebyte declared,
a fake one will be given (0x01).
A TypeByte of 0x00 is reserved for nil things.
No nil-dogs.
This commit is contained in:
Jae Kwon
2015-04-12 17:46:16 -07:00
parent 1364770cbe
commit 6d6f061f19
20 changed files with 299 additions and 178 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ type TxInput struct {
Amount uint64 // Must not exceed account balance
Sequence uint // Must be 1 greater than the last committed TxInput
Signature account.Signature // Depends on the PubKey type and the whole Tx
PubKey account.PubKey // Must not be nil, may be PubKeyNil.
PubKey account.PubKey // Must not be nil, may be nil
}
func (txIn *TxInput) ValidateBasic() error {
+3 -3
View File
@@ -40,9 +40,9 @@ type Vote struct {
// Types of votes
const (
VoteTypePrevote = byte(0x00)
VoteTypePrecommit = byte(0x01)
VoteTypeCommit = byte(0x02)
VoteTypePrevote = byte(0x01)
VoteTypePrecommit = byte(0x02)
VoteTypeCommit = byte(0x03)
)
func (vote *Vote) WriteSignBytes(w io.Writer, n *int64, err *error) {