multi: comprehensive typo fixes across all packages

This commit is contained in:
practicalswift authored and Olaoluwa Osuntokun committed 2018-02-06 19:11:11 -08:00
1 parent 72a5bc8648
commit a93736d21e
103 files changed
+435 -435

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ import (
// receiver's pending set into a new commitment state. Implicitly, the new
// commitment transaction constructed which has been signed by CommitSig
// includes all HTLC's in the remote node's pending set. A CommitSig message
// may be sent after a series of UpdateAddHTLC/UpdateFufillHTLC messages in
// may be sent after a series of UpdateAddHTLC/UpdateFulfillHTLC messages in
// order to batch add several HTLC's with a single signature covering all
// implicitly accepted HTLC's.
type CommitSig struct {
+1 -1
View File
@@ -84,7 +84,7 @@ func TestFeatureVectorSetUnset(t *testing.T) {
for j, expectedSet := range test.expectedFeatures {
if fv.HasFeature(FeatureBit(j)) != expectedSet {
t.Errorf("Expection failed in case %d, bit %d", i, j)
t.Errorf("Expectation failed in case %d, bit %d", i, j)
break
}
}
+2 -2
View File
@@ -563,8 +563,8 @@ func TestLightningWireProtocol(t *testing.T) {
},
},
{
msgType: MsgUpdateFufillHTLC,
scenario: func(m UpdateFufillHTLC) bool {
msgType: MsgUpdateFulfillHTLC,
scenario: func(m UpdateFulfillHTLC) bool {
return mainScenario(&m)
},
},
+6 -6
View File
@@ -19,7 +19,7 @@ const MaxMessagePayload = 65535 // 65KB
// MessageType is the unique 2 byte big-endian integer that indicates the type
// of message on the wire. All messages have a very simple header which
// consists simply of 2-byte message type. We omit a length field, and checksum
// as the Lighting Protocol is intended to be encapsulated within a
// as the Lightning Protocol is intended to be encapsulated within a
// confidential+authenticated cryptographic messaging protocol.
type MessageType uint16
@@ -38,7 +38,7 @@ const (
MsgShutdown = 38
MsgClosingSigned = 39
MsgUpdateAddHTLC = 128
MsgUpdateFufillHTLC = 130
MsgUpdateFulfillHTLC = 130
MsgUpdateFailHTLC = 131
MsgCommitSig = 132
MsgRevokeAndAck = 133
@@ -74,8 +74,8 @@ func (t MessageType) String() string {
return "UpdateAddHTLC"
case MsgUpdateFailHTLC:
return "UpdateFailHTLC"
case MsgUpdateFufillHTLC:
return "UpdateFufillHTLC"
case MsgUpdateFulfillHTLC:
return "UpdateFulfillHTLC"
case MsgCommitSig:
return "CommitSig"
case MsgRevokeAndAck:
@@ -165,8 +165,8 @@ func makeEmptyMessage(msgType MessageType) (Message, error) {
msg = &UpdateAddHTLC{}
case MsgUpdateFailHTLC:
msg = &UpdateFailHTLC{}
case MsgUpdateFufillHTLC:
msg = &UpdateFufillHTLC{}
case MsgUpdateFulfillHTLC:
msg = &UpdateFulfillHTLC{}
case MsgCommitSig:
msg = &CommitSig{}
case MsgRevokeAndAck:
+1 -1
View File
@@ -46,7 +46,7 @@ func (n *NetAddress) String() string {
return fmt.Sprintf("%x@%v", pubkey, n.Address)
}
// Network returns the name of the network this address is binded to.
// Network returns the name of the network this address is bound to.
//
// This part of the net.Addr interface.
func (n *NetAddress) Network() string {
+2 -2
View File
@@ -26,11 +26,11 @@ type FailureMessage interface {
}
// failureMessageLength is the size of the failure message plus the size of
// padding. The FailureMessage message should always be EXACLTY this size.
// padding. The FailureMessage message should always be EXACTLY this size.
const failureMessageLength = 256
const (
// FlagBadOnion error flag describes an unparseable, encrypted by
// FlagBadOnion error flag describes an unparsable, encrypted by
// previous node.
FlagBadOnion FailCode = 0x8000
+1 -1
View File
@@ -17,7 +17,7 @@ func SerializeSigToWire(b *[64]byte, e *btcec.Signature) error {
// 0x30 <length> 0x02 <length r> r 0x02 <length s> s
// which means the length of R is the 4th byte and the length of S
// is the second byte after R ends. 0x02 signifies a length-prefixed,
// zero-padded, big-endian bigint. 0x30 sigifies a DER signature.
// zero-padded, big-endian bigint. 0x30 signifies a DER signature.
// See the Serialize() method for btcec.Signature for details.
rLen := sig[3]
sLen := sig[5+rLen]
+16 -16
View File
@@ -2,12 +2,12 @@ package lnwire
import "io"
// UpdateFufillHTLC is sent by Alice to Bob when she wishes to settle a
// UpdateFulfillHTLC is sent by Alice to Bob when she wishes to settle a
// particular HTLC referenced by its HTLCKey within a specific active channel
// referenced by ChannelPoint. A subsequent CommitSig message will be sent by
// Alice to "lock-in" the removal of the specified HTLC, possible containing a
// batch signature covering several settled HTLC's.
type UpdateFufillHTLC struct {
type UpdateFulfillHTLC struct {
// ChanID references an active channel which holds the HTLC to be
// settled.
ChanID ChannelID
@@ -21,26 +21,26 @@ type UpdateFufillHTLC struct {
PaymentPreimage [32]byte
}
// NewUpdateFufillHTLC returns a new empty UpdateFufillHTLC.
func NewUpdateFufillHTLC(chanID ChannelID, id uint64,
preimage [32]byte) *UpdateFufillHTLC {
// NewUpdateFulfillHTLC returns a new empty UpdateFulfillHTLC.
func NewUpdateFulfillHTLC(chanID ChannelID, id uint64,
preimage [32]byte) *UpdateFulfillHTLC {
return &UpdateFufillHTLC{
return &UpdateFulfillHTLC{
ChanID: chanID,
ID: id,
PaymentPreimage: preimage,
}
}
// A compile time check to ensure UpdateFufillHTLC implements the lnwire.Message
// A compile time check to ensure UpdateFulfillHTLC implements the lnwire.Message
// interface.
var _ Message = (*UpdateFufillHTLC)(nil)
var _ Message = (*UpdateFulfillHTLC)(nil)
// Decode deserializes a serialized UpdateFufillHTLC message stored in the passed
// Decode deserializes a serialized UpdateFulfillHTLC message stored in the passed
// io.Reader observing the specified protocol version.
//
// This is part of the lnwire.Message interface.
func (c *UpdateFufillHTLC) Decode(r io.Reader, pver uint32) error {
func (c *UpdateFulfillHTLC) Decode(r io.Reader, pver uint32) error {
return readElements(r,
&c.ChanID,
&c.ID,
@@ -48,11 +48,11 @@ func (c *UpdateFufillHTLC) Decode(r io.Reader, pver uint32) error {
)
}
// Encode serializes the target UpdateFufillHTLC into the passed io.Writer
// Encode serializes the target UpdateFulfillHTLC into the passed io.Writer
// observing the protocol version specified.
//
// This is part of the lnwire.Message interface.
func (c *UpdateFufillHTLC) Encode(w io.Writer, pver uint32) error {
func (c *UpdateFulfillHTLC) Encode(w io.Writer, pver uint32) error {
return writeElements(w,
c.ChanID,
c.ID,
@@ -64,15 +64,15 @@ func (c *UpdateFufillHTLC) Encode(w io.Writer, pver uint32) error {
// wire.
//
// This is part of the lnwire.Message interface.
func (c *UpdateFufillHTLC) MsgType() MessageType {
return MsgUpdateFufillHTLC
func (c *UpdateFulfillHTLC) MsgType() MessageType {
return MsgUpdateFulfillHTLC
}
// MaxPayloadLength returns the maximum allowed payload size for a UpdateFufillHTLC
// MaxPayloadLength returns the maximum allowed payload size for a UpdateFulfillHTLC
// complete message observing the specified protocol version.
//
// This is part of the lnwire.Message interface.
func (c *UpdateFufillHTLC) MaxPayloadLength(uint32) uint32 {
func (c *UpdateFulfillHTLC) MaxPayloadLength(uint32) uint32 {
// 32 + 8 + 32
return 72
}