Skip to content

Ember Essence (v0.4.6)

Latest
Compare
Choose a tag to compare
@sarvalabs-manish sarvalabs-manish released this 25 Oct 22:46
· 4 commits to main since this release

v0.4.6 is a minor feature release that brings a cleaner workflow for implementing custom decoding with the Depolorizable interface. Previously this required some verbosity to be a concrete implementation (see below for more). This release also adds independent decode methods for all integer sizes to allow more brevity when decoding directly into struct fields. Additionally significant improvements have been made to the unit tests to be independently runnable and go-polo is now back to 100% test coverage!

Clean Custom Depolorization

  • Depolorizer now has some behaviors to support a simpler workflow when custom decoding to structs. Previously a call to Depolorizer.DepolorizePacked was necessary to decompose the outer wire's pack element into its own Depolorizer and this method returned an ErrNullPack to indicate that the wire element is null and cannot be unpacked.
  • Now, Depolorizer.DepolorizePacked is strict and does not allow the WireNull type and now returns the IncompatibleWire error if it encounters it. This makes the behavior easier to debug for unfamiliar users. This is enhanced by the fact that this same capability can be achieved with the new Unpacked method that acts as a mirror to the Polorizer.Packed method
  • Additionally a new method Depolorizer.IsNull peeks the next element in the wire and returns true if it is a WireNull. Allowing a consumer to separately handle the nullity check of the wire when decoding from a Depolorizer. It is still necessary to pop this element if further decoding is required and this can be achieved using the Depolorizer.DepolorizeNull

Changelog: