lnwire: rename routing files to match current naming conventions

This commit drops the “_message” at the end of each of the newly added
routing files.
This commit is contained in:
Olaoluwa Osuntokun
2016-08-11 11:54:44 -07:00
parent 3563d0e6b9
commit c0d59a2d85
8 changed files with 69 additions and 59 deletions

View File

@@ -3,6 +3,7 @@
// file LICENSE or http://www.opensource.org/licenses/mit-license.php
package lnwire
import (
"fmt"
"io"

View File

@@ -5,10 +5,11 @@
package lnwire
import (
"io"
"github.com/BitfuryLightning/tools/rt"
"encoding/gob"
"fmt"
"io"
"github.com/BitfuryLightning/tools/rt"
)
type NeighborHelloMessage struct {
@@ -48,5 +49,4 @@ func (msg *NeighborHelloMessage) String() string{
return fmt.Sprintf("NeighborHelloMessage{%v %v %v}", msg.SenderID, msg.ReceiverID, msg.RT)
}
var _ Message = (*NeighborHelloMessage)(nil)

View File

@@ -5,8 +5,9 @@
package lnwire
import (
"testing"
"bytes"
"testing"
"github.com/BitfuryLightning/tools/rt"
"github.com/BitfuryLightning/tools/rt/graph"
)
@@ -37,5 +38,3 @@ func TestNeighborHelloMessageEncodeDecode(t *testing.T){
t.Errorf("msg2.RT.HasChannel(Id2, Id1) = false, want true")
}
}

View File

@@ -3,6 +3,7 @@
// file LICENSE or http://www.opensource.org/licenses/mit-license.php
package lnwire
import (
"fmt"
"io"

View File

@@ -5,10 +5,11 @@
package lnwire
import (
"fmt"
"github.com/BitfuryLightning/tools/rt"
"encoding/gob"
"fmt"
"io"
"github.com/BitfuryLightning/tools/rt"
)
type NeighborUpdMessage struct {

View File

@@ -8,20 +8,27 @@ import (
"github.com/BitfuryLightning/tools/rt/graph"
)
// RoutingMessageBase is the base struct for all routing messages within the
// lnwire package.
type RoutingMessageBase struct {
// SenderID is the ID of the sender of the routing message.
SenderID graph.ID
// ReceiverID is the ID of the receiver of the routig message.
ReceiverID graph.ID
}
// GetReceiverID returns the ID of the receiver of routing message.
func (msg RoutingMessageBase) GetReceiverID() graph.ID {
return msg.ReceiverID
}
// GetSenderID returns the ID of the sender of the routing message.
func (msg RoutingMessageBase) GetSenderID() graph.ID {
return msg.SenderID
}
// Interface for all routing messages. All messages have sender and receiver
// RoutingMessageBase is a shared interface for all routing messages.
type RoutingMessage interface {
GetSenderID() graph.ID
GetReceiverID() graph.ID

View File

@@ -3,6 +3,7 @@
// file LICENSE or http://www.opensource.org/licenses/mit-license.php
package lnwire
import (
"fmt"
"io"
@@ -16,7 +17,6 @@ func (msg *RoutingTableRequestMessage) String() string {
return fmt.Sprintf("RoutingTableRequestMessage{%v %v}", msg.SenderID, msg.ReceiverID)
}
func (msg *RoutingTableRequestMessage) Command() uint32 {
return CmdRoutingTableRequestMessage
}

View File

@@ -5,10 +5,11 @@
package lnwire
import (
"io"
"github.com/BitfuryLightning/tools/rt"
"encoding/gob"
"fmt"
"io"
"github.com/BitfuryLightning/tools/rt"
)
type RoutingTableTransferMessage struct {