multi: rename AnnounceSignatures to AnnounceSignatures1
In preparation for adding a new message, AnnounceSignatures2 along with an AnnounceSignatures interface, we rename the existing message to AnnounceSignatures1.
This commit is contained in:
14 files changed
+47
-44
No files matched your search
@@ -5,11 +5,11 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// AnnounceSignatures is a direct message between two endpoints of a
|
||||
// AnnounceSignatures1 is a direct message between two endpoints of a
|
||||
// channel and serves as an opt-in mechanism to allow the announcement of
|
||||
// the channel to the rest of the network. It contains the necessary
|
||||
// signatures by the sender to construct the channel announcement message.
|
||||
type AnnounceSignatures struct {
|
||||
type AnnounceSignatures1 struct {
|
||||
// ChannelID is the unique description of the funding transaction.
|
||||
// Channel id is better for users and debugging and short channel id is
|
||||
// used for quick test on existence of the particular utxo inside the
|
||||
@@ -43,15 +43,15 @@ type AnnounceSignatures struct {
|
||||
ExtraOpaqueData ExtraOpaqueData
|
||||
}
|
||||
|
||||
// A compile time check to ensure AnnounceSignatures implements the
|
||||
// A compile time check to ensure AnnounceSignatures1 implements the
|
||||
// lnwire.Message interface.
|
||||
var _ Message = (*AnnounceSignatures)(nil)
|
||||
var _ Message = (*AnnounceSignatures1)(nil)
|
||||
|
||||
// Decode deserializes a serialized AnnounceSignatures stored in the passed
|
||||
// Decode deserializes a serialized AnnounceSignatures1 stored in the passed
|
||||
// io.Reader observing the specified protocol version.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *AnnounceSignatures) Decode(r io.Reader, pver uint32) error {
|
||||
func (a *AnnounceSignatures1) Decode(r io.Reader, pver uint32) error {
|
||||
return ReadElements(r,
|
||||
&a.ChannelID,
|
||||
&a.ShortChannelID,
|
||||
@@ -61,11 +61,11 @@ func (a *AnnounceSignatures) Decode(r io.Reader, pver uint32) error {
|
||||
)
|
||||
}
|
||||
|
||||
// Encode serializes the target AnnounceSignatures into the passed io.Writer
|
||||
// Encode serializes the target AnnounceSignatures1 into the passed io.Writer
|
||||
// observing the protocol version specified.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *AnnounceSignatures) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
func (a *AnnounceSignatures1) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
if err := WriteChannelID(w, a.ChannelID); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -89,6 +89,6 @@ func (a *AnnounceSignatures) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
// wire.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (a *AnnounceSignatures) MsgType() MessageType {
|
||||
func (a *AnnounceSignatures1) MsgType() MessageType {
|
||||
return MsgAnnounceSignatures
|
||||
}
|
||||
@@ -1138,7 +1138,7 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
},
|
||||
MsgAnnounceSignatures: func(v []reflect.Value, r *rand.Rand) {
|
||||
var err error
|
||||
req := AnnounceSignatures{
|
||||
req := AnnounceSignatures1{
|
||||
ShortChannelID: NewShortChanIDFromInt(uint64(r.Int63())),
|
||||
ExtraOpaqueData: make([]byte, 0),
|
||||
}
|
||||
@@ -1649,7 +1649,7 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
},
|
||||
{
|
||||
msgType: MsgAnnounceSignatures,
|
||||
scenario: func(m AnnounceSignatures) bool {
|
||||
scenario: func(m AnnounceSignatures1) bool {
|
||||
return mainScenario(&m)
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ func makeEmptyMessage(msgType MessageType) (Message, error) {
|
||||
case MsgPing:
|
||||
msg = &Ping{}
|
||||
case MsgAnnounceSignatures:
|
||||
msg = &AnnounceSignatures{}
|
||||
msg = &AnnounceSignatures1{}
|
||||
case MsgPong:
|
||||
msg = &Pong{}
|
||||
case MsgQueryShortChanIDs:
|
||||
|
||||
@@ -727,11 +727,11 @@ func newMsgChannelUpdate(t testing.TB, r *rand.Rand) *lnwire.ChannelUpdate {
|
||||
}
|
||||
|
||||
func newMsgAnnounceSignatures(t testing.TB,
|
||||
r *rand.Rand) *lnwire.AnnounceSignatures {
|
||||
r *rand.Rand) *lnwire.AnnounceSignatures1 {
|
||||
|
||||
t.Helper()
|
||||
|
||||
msg := &lnwire.AnnounceSignatures{
|
||||
msg := &lnwire.AnnounceSignatures1{
|
||||
ShortChannelID: lnwire.NewShortChanIDFromInt(
|
||||
uint64(r.Int63()),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user