Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clarify comments re dag-cbor extension data #341

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions message/v1/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ func (mh *MessageHandler) newMessageFromProto(p peer.ID, pbm *pb.Message) (messa
return message.NewMessage(requests, responses, blks), nil
}

// TODO: is this a breaking protocol change? force all extension data into dag-cbor?
// Note that even for protocol v1 we now only support DAG-CBOR encoded extension data.
// Anything else will be rejected with an error.
func toEncodedExtensions(part MessagePartWithExtensions) (map[string][]byte, error) {
names := part.ExtensionNames()
out := make(map[string][]byte, len(names))
Expand All @@ -264,7 +265,6 @@ func toEncodedExtensions(part MessagePartWithExtensions) (map[string][]byte, err
return out, nil
}

// TODO: is this a breaking protocol change? force all extension data into dag-cbor?
func fromEncodedExtensions(in map[string][]byte) ([]graphsync.ExtensionData, error) {
if in == nil {
return []graphsync.ExtensionData{}, nil
Expand Down