Move json/cbor rpc to lib
This commit is contained in:
+3
-3
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/filecoin-project/go-lotus/chain"
|
||||
"github.com/filecoin-project/go-lotus/lib"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/cborrpc"
|
||||
"github.com/libp2p/go-libp2p-core/host"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -46,7 +46,7 @@ func (hs *Service) HandleStream(s inet.Stream) {
|
||||
defer s.Close()
|
||||
|
||||
var hmsg Message
|
||||
if err := cborrpc.ReadCborRPC(s, &hmsg); err != nil {
|
||||
if err := lib.ReadCborRPC(s, &hmsg); err != nil {
|
||||
log.Infow("failed to read hello message", "error", err)
|
||||
return
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
|
||||
fmt.Println("SENDING HELLO MESSAGE: ", hts.Cids())
|
||||
fmt.Println("hello message genesis: ", gen.Cid())
|
||||
|
||||
if err := cborrpc.WriteCborRPC(s, hmsg); err != nil {
|
||||
if err := lib.WriteCborRPC(s, hmsg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user