This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Additionally accept number equal to 1 or 0 while validating data type of bool during serialization.#624
Closed
terrylks wants to merge 1 commit intoEOSIO:masterfrom
Closed
Additionally accept number equal to 1 or 0 while validating data type of bool during serialization.#624terrylks wants to merge 1 commit intoEOSIO:masterfrom
terrylks wants to merge 1 commit intoEOSIO:masterfrom
Conversation
Contributor
Author
|
@GreenBusDriver @tbfleming Please note. |
2 tasks
Contributor
|
Closing in favor of #629 due to adding tests and switching base branch to develop. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Change:
For the validation of data type of bool during serialization, additionally accept number which equal to 1 or 0.
Reason of the change:
You could see there is a
buffer.push(data ? 1 : 0);just below the changed line. It converts all boolean value to 1 or 0.Hence, if we fetch the payload in an action which is pushed by eosjs before, all boolean fields would become 1 or 0. If we repeat the same payload with the field using value of 1 or 0, it will be invalidated during the check because the check only accept boolean as the data type.
In our latest eosio-explorer required feature, there is a repeat push action feature which depends on the last fetched payload and it will be blocked by the check ( not accepting 1 or 0 ). We need this change in eosjs for us to finish the feature.
API Changes
Documentation Additions