Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
0d3b0f10
Commit
0d3b0f10
authored
Sep 14, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(bs:msg) remove swarm.Message
no longer exists. instead, use net message
parent
68216245
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
16 deletions
+0
-16
bitswap/message/message.go
bitswap/message/message.go
+0
-16
No files found.
bitswap/message/message.go
View file @
0d3b0f10
...
...
@@ -3,12 +3,10 @@ package message
import
(
"errors"
proto
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
netmsg
"github.com/jbenet/go-ipfs/net/message"
blocks
"github.com/jbenet/go-ipfs/blocks"
nm
"github.com/jbenet/go-ipfs/net/message"
swarm
"github.com/jbenet/go-ipfs/net/swarm"
peer
"github.com/jbenet/go-ipfs/peer"
u
"github.com/jbenet/go-ipfs/util"
)
...
...
@@ -23,7 +21,6 @@ type BitSwapMessage interface {
type
Exportable
interface
{
ToProto
()
*
PBMessage
ToSwarm
(
p
*
peer
.
Peer
)
*
swarm
.
Message
ToNet
(
p
*
peer
.
Peer
)
(
nm
.
NetMessage
,
error
)
}
...
...
@@ -74,24 +71,11 @@ func FromNet(nmsg netmsg.NetMessage) (BitSwapMessage, error) {
return
nil
,
errors
.
New
(
"TODO implement"
)
}
func
FromSwarm
(
sms
swarm
.
Message
)
(
BitSwapMessage
,
error
)
{
var
protoMsg
PBMessage
err
:=
proto
.
Unmarshal
(
sms
.
Data
,
&
protoMsg
)
if
err
!=
nil
{
return
nil
,
err
}
return
newMessageFromProto
(
protoMsg
),
nil
}
func
(
m
*
message
)
ToProto
()
*
PBMessage
{
cp
:=
m
.
pb
return
&
cp
}
func
(
m
*
message
)
ToSwarm
(
p
*
peer
.
Peer
)
*
swarm
.
Message
{
return
swarm
.
NewMessage
(
p
,
m
.
ToProto
())
}
func
(
m
*
message
)
ToNet
(
p
*
peer
.
Peer
)
(
nm
.
NetMessage
,
error
)
{
return
nm
.
FromObject
(
p
,
m
.
ToProto
())
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment