You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
The protocol specs of any component in the system must be deterministic, means input and output must defined explicitly for every case. And there must not be any modifications/mutations to output/input runtime to pass the tests.
Currently we have protocol specs for lisk-codec encoding behaviour, but we don't have it for decoding behaviour. And as per our implementation of lisk-codec and by specification of the LIP the encoding and decoding may not turn out be same as always. e.g. Its a viable chance that in example below data and reverseData may not match strictly because of the default values for properties which are not defined in the data object.
To cover this part we had a lot of custom manipulation of protocol specs in test suites, which does not fulfil the purpose of having protocol specs. e.g. few of reference mentioned below. We need to improve these and protocol specs must define the decoding specs and we should avoid runtime mutation of specs input/output in our tests
Description
The protocol specs of any component in the system must be deterministic, means input and output must defined explicitly for every case. And there must not be any modifications/mutations to output/input runtime to pass the tests.
Currently we have protocol specs for lisk-codec
encoding
behaviour, but we don't have it fordecoding
behaviour. And as per our implementation oflisk-codec
and by specification of the LIP the encoding and decoding may not turn out be same as always. e.g. Its a viable chance that in example belowdata
andreverseData
may not match strictly because of the default values for properties which are not defined in thedata
object.To cover this part we had a lot of custom manipulation of protocol specs in test suites, which does not fulfil the purpose of having protocol specs. e.g. few of reference mentioned below. We need to improve these and protocol specs must define the decoding specs and we should avoid runtime mutation of specs input/output in our tests
https://github.com/LiskHQ/lisk-sdk/blob/2db69cdd52b2ea8461525a34c388619921481c64/elements/lisk-codec/test/decode.spec.ts#L67-L71
https://github.com/LiskHQ/lisk-sdk/blob/2db69cdd52b2ea8461525a34c388619921481c64/elements/lisk-codec/test/decode.spec.ts#L113-L117
https://github.com/LiskHQ/lisk-sdk/blob/2db69cdd52b2ea8461525a34c388619921481c64/elements/lisk-codec/test/decode.spec.ts#L161-L167
Motivation
The protocol specs for Lisk-Codec must deterministic and cover both encoding and decoding behaviours.
Additional Information
The text was updated successfully, but these errors were encountered: