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

General decode/encode functions #67

Open
jordy25519 opened this issue Jul 21, 2020 · 0 comments
Open

General decode/encode functions #67

jordy25519 opened this issue Jul 21, 2020 · 0 comments
Labels
refactor Something needs refactoring

Comments

@jordy25519
Copy link
Contributor

jordy25519 commented Jul 21, 2020

The doughnut encode/decode methods are coupled (one and the same) with the parity-scale-codec trait.

It would be better to provide independent encode/decode functions which the parity-scale-codec impls can simply call into.
The parity-scale-codec use has some implications around the input buffer type and errors types which make it not the best API for general use outside of substrate.

The general functions could enable things like:

  • extraneous bytes checks on decoding as an option
  • encoding with 0 domains as error (currently fails silently encodes nothing, which is confusing)
@jordy25519 jordy25519 added the refactor Something needs refactoring label Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Something needs refactoring
Projects
None yet
Development

No branches or pull requests

1 participant