mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-03-23 12:30:08 +08:00
go fmt
This commit is contained in:
parent
2ebfd9d4f2
commit
c016eb5a80
@ -20,11 +20,11 @@ type SignedEnvelope struct {
|
||||
|
||||
// A binary identifier that indicates what kind of data is contained in the payload.
|
||||
// TODO(yusef): enforce multicodec prefix
|
||||
TypeHint []byte
|
||||
TypeHint []byte
|
||||
|
||||
// The envelope payload. This is private to discourage accessing the payload without verifying the signature.
|
||||
// To access, use the Open method.
|
||||
contents []byte
|
||||
contents []byte
|
||||
|
||||
// The signature of the domain string, type hint, and contents.
|
||||
signature []byte
|
||||
@ -91,8 +91,8 @@ func (e *SignedEnvelope) Marshal() ([]byte, error) {
|
||||
}
|
||||
msg := pb.SignedEnvelope{
|
||||
PublicKey: key,
|
||||
TypeHint: e.TypeHint,
|
||||
Contents: e.contents,
|
||||
TypeHint: e.TypeHint,
|
||||
Contents: e.contents,
|
||||
Signature: e.signature,
|
||||
}
|
||||
return proto.Marshal(&msg)
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/libp2p/go-libp2p-core/crypto"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
pb "github.com/libp2p/go-libp2p-core/routing/pb"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -47,8 +47,8 @@ func RoutingStateFromAddrInfo(info *peer.AddrInfo) *RoutingState {
|
||||
annotated[i] = &AnnotatedAddr{Multiaddr: a}
|
||||
}
|
||||
return &RoutingState{
|
||||
PeerID: info.ID,
|
||||
Seq: statelessSeqNo(),
|
||||
PeerID: info.ID,
|
||||
Seq: statelessSeqNo(),
|
||||
Addresses: annotated,
|
||||
}
|
||||
}
|
||||
@ -106,8 +106,8 @@ func (s *RoutingState) Marshal() ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
msg := pb.RoutingStateRecord{
|
||||
PeerId: id,
|
||||
Seq: s.Seq,
|
||||
PeerId: id,
|
||||
Seq: s.Seq,
|
||||
Addresses: addrsToProtobuf(s.Addresses),
|
||||
}
|
||||
return proto.Marshal(&msg)
|
||||
|
Loading…
Reference in New Issue
Block a user