multi: rename FundingLocked to ChannelReady
This commit is created by running, ```shell gofmt -d -w -r 'FundingLocked -> ChannelReady' . gco master channeldb/migration ```
This commit is contained in:
10 files changed
+51
-51
No files matched your search
@@ -13,7 +13,7 @@ import (
|
||||
// blockchain. FundingLocked contains the signatures necessary for the channel
|
||||
// participants to advertise the existence of the channel to the rest of the
|
||||
// network.
|
||||
type FundingLocked struct {
|
||||
type ChannelReady struct {
|
||||
// ChanID is the outpoint of the channel's funding transaction. This
|
||||
// can be used to query for the channel in the database.
|
||||
ChanID ChannelID
|
||||
@@ -35,8 +35,8 @@ type FundingLocked struct {
|
||||
|
||||
// NewFundingLocked creates a new FundingLocked message, populating it with the
|
||||
// necessary IDs and revocation secret.
|
||||
func NewFundingLocked(cid ChannelID, npcp *btcec.PublicKey) *FundingLocked {
|
||||
return &FundingLocked{
|
||||
func NewFundingLocked(cid ChannelID, npcp *btcec.PublicKey) *ChannelReady {
|
||||
return &ChannelReady{
|
||||
ChanID: cid,
|
||||
NextPerCommitmentPoint: npcp,
|
||||
ExtraData: make([]byte, 0),
|
||||
@@ -45,14 +45,14 @@ func NewFundingLocked(cid ChannelID, npcp *btcec.PublicKey) *FundingLocked {
|
||||
|
||||
// A compile time check to ensure FundingLocked implements the lnwire.Message
|
||||
// interface.
|
||||
var _ Message = (*FundingLocked)(nil)
|
||||
var _ Message = (*ChannelReady)(nil)
|
||||
|
||||
// Decode deserializes the serialized FundingLocked message stored in the
|
||||
// passed io.Reader into the target FundingLocked using the deserialization
|
||||
// rules defined by the passed protocol version.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (c *FundingLocked) Decode(r io.Reader, pver uint32) error {
|
||||
func (c *ChannelReady) Decode(r io.Reader, pver uint32) error {
|
||||
// Read all the mandatory fields in the message.
|
||||
err := ReadElements(r,
|
||||
&c.ChanID,
|
||||
@@ -85,7 +85,7 @@ func (c *FundingLocked) Decode(r io.Reader, pver uint32) error {
|
||||
// protocol version.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (c *FundingLocked) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
func (c *ChannelReady) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
if err := WriteChannelID(w, c.ChanID); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -110,6 +110,6 @@ func (c *FundingLocked) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
// FundingLocked message on the wire.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (c *FundingLocked) MsgType() MessageType {
|
||||
func (c *ChannelReady) MsgType() MessageType {
|
||||
return MsgFundingLocked
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
},
|
||||
{
|
||||
msgType: MsgFundingLocked,
|
||||
scenario: func(m FundingLocked) bool {
|
||||
scenario: func(m ChannelReady) bool {
|
||||
return mainScenario(&m)
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ func makeEmptyMessage(msgType MessageType) (Message, error) {
|
||||
case MsgFundingSigned:
|
||||
msg = &FundingSigned{}
|
||||
case MsgFundingLocked:
|
||||
msg = &FundingLocked{}
|
||||
msg = &ChannelReady{}
|
||||
case MsgShutdown:
|
||||
msg = &Shutdown{}
|
||||
case MsgClosingSigned:
|
||||
|
||||
@@ -442,7 +442,7 @@ func newMsgFundingSigned(t testing.TB, r io.Reader) *lnwire.FundingSigned {
|
||||
return msg
|
||||
}
|
||||
|
||||
func newMsgFundingLocked(t testing.TB, r io.Reader) *lnwire.FundingLocked {
|
||||
func newMsgFundingLocked(t testing.TB, r io.Reader) *lnwire.ChannelReady {
|
||||
t.Helper()
|
||||
|
||||
var c [32]byte
|
||||
|
||||
Reference in new issue
Block a user