-
Notifications
You must be signed in to change notification settings - Fork 48
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
chore: replace protons with protobufjs #319
Conversation
Replaces protons with the official protobufjs module.
wantType: Message.Wantlist.WantType.Block | ||
}) | ||
const deserialized = await BitswapMessage.deserialize(serialized) | ||
expect(deserialized.wantlist.get(cid.toString())).to.have.nested.property('entry.wantType', Message.Wantlist.WantType.Block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protons did some non-standard things here - sendDontHave
and wantType
should come back as undefined but instead came back as false
and 0
respectively in line with the comment in the .proto definition.
Protobufjs follows the spec and does not do this so we can't test against the output of the protobuf deserializer but neither should we, really as it's not the unit under test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protons was a mess, happy that we are getting rid of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Pending CI failure on the bundlesize
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
Replaces protons with the official protobufjs module.