lnwire: properly display channel points in .String() methods

This commit is contained in:
Olaoluwa Osuntokun 2016-07-12 17:05:13 -07:00
parent 9b5e487893
commit c8de0924ba
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
4 changed files with 9 additions and 5 deletions

@ -127,9 +127,12 @@ func (c *CommitRevocation) Validate() error {
// This is part of the lnwire.Message interface.
// TODO(roasbeef): remote all String() methods...spew should be used instead.
func (c *CommitRevocation) String() string {
keySer := c.NextRevocationKey.SerializeCompressed()
return fmt.Sprintf("\n--- Begin CommitRevocation ---\n") +
fmt.Sprintf("ChannelPoint:\t%d\n", c.ChannelPoint) +
fmt.Sprintf("NextRevocationHash:\t%x\n", c.NextRevocationHash) +
fmt.Sprintf("ChannelPoint:\t%v\n", c.ChannelPoint) +
fmt.Sprintf("Revocation:\t%x\n", c.Revocation) +
fmt.Sprintf("NextRevocationKey:\t%x\n", keySer) +
fmt.Sprintf("NextRevocationHash:\t%x\n", c.NextRevocationHash) +
fmt.Sprintf("--- End CommitRevocation ---\n")
}

@ -130,7 +130,8 @@ func (c *CommitSignature) String() string {
}
return fmt.Sprintf("\n--- Begin CommitSignature ---\n") +
fmt.Sprintf("ChannelPoint:\t%d\n", c.ChannelPoint) +
fmt.Sprintf("ChannelPoint:\t%v\n", c.ChannelPoint) +
fmt.Sprintf("LogIndex:\t\t%v\n", c.LogIndex) +
fmt.Sprintf("Fee:\t\t\t%s\n", c.Fee.String()) +
fmt.Sprintf("CommitSig:\t\t%x\n", serializedSig) +
fmt.Sprintf("--- End CommitSignature ---\n")

@ -158,7 +158,7 @@ func (c *HTLCAddRequest) String() string {
}
return fmt.Sprintf("\n--- Begin HTLCAddRequest ---\n") +
fmt.Sprintf("ChannelPoint:\t%d\n", c.ChannelPoint) +
fmt.Sprintf("ChannelPoint:\t%v\n", c.ChannelPoint) +
fmt.Sprintf("Expiry:\t\t%d\n", c.Expiry) +
fmt.Sprintf("Amount\t\t%d\n", c.Amount) +
fmt.Sprintf("ContractType:\t%d (%b)\n", c.ContractType, c.ContractType) +

@ -119,7 +119,7 @@ func (c *HTLCSettleRequest) String() string {
}
return fmt.Sprintf("\n--- Begin HTLCSettleRequest ---\n") +
fmt.Sprintf("ChannelPoint:\t%d\n", c.ChannelPoint) +
fmt.Sprintf("ChannelPoint:\t%v\n", c.ChannelPoint) +
fmt.Sprintf("HTLCKey:\t%d\n", c.HTLCKey) +
fmt.Sprintf("RedemptionHashes:") +
redemptionProofs +