Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Create function to traverse the object for encoding #5217

Closed
pablitovicente opened this issue Apr 29, 2020 · 0 comments · Fixed by #5322
Closed

Create function to traverse the object for encoding #5217

pablitovicente opened this issue Apr 29, 2020 · 0 comments · Fixed by #5322
Assignees
Milestone

Comments

@pablitovicente
Copy link
Contributor

pablitovicente commented Apr 29, 2020

Description

Implement encode(schema: object, message: any) => Buffer in lisk-codec

Motivation

We need to generate a binary message given an object and its schema.

Acceptance Criteria

  • encode() can generate a buffer from any object based on its schema
  • encode() should cache the schema and generate a simpler encoder on first run
  • encode() should support any writer we might add in the future
  • The generated encoder should be able to generate the key/keys for each property
  • The generated encoder picks the correct writer for each property
  • Code should be optimised for speed as much as possible
  • Full test coverage
  • Performance stats are provided based on the encoding of the smallest and biggest objects possible in the Lisk network

Additional Information

  • encode() will use a set of writers for each specific data type defined in the schema (this will be detailed in separated issues)

Related issues: #5200

@pablitovicente pablitovicente self-assigned this Apr 29, 2020
@ManuGowda ManuGowda changed the title Implement encode function Create function to traverse the object for encoding May 6, 2020
@sridharmeganathan sridharmeganathan added this to the Sprint 19 milestone May 10, 2020
shuse2 added a commit that referenced this issue May 25, 2020
…_the_object_for_encoding

Create function to traverse the object for encoding - Closes #5217 & #5228 & #5235
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants