Skip to content
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
terrylks:accept-1-and-0
Closed

Additionally accept number equal to 1 or 0 while validating data type of bool during serialization.#624
terrylks wants to merge 1 commit intoEOSIO:masterfrom
terrylks:accept-1-and-0

Conversation

@terrylks
Copy link
Copy Markdown
Contributor

@terrylks terrylks commented Dec 6, 2019

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

  • API Changes

Documentation Additions

  • Documentation Additions

@terrylks
Copy link
Copy Markdown
Contributor Author

terrylks commented Dec 6, 2019

@GreenBusDriver @tbfleming Please note.

@jlamarr22
Copy link
Copy Markdown
Contributor

Closing in favor of #629 due to adding tests and switching base branch to develop.

@jlamarr22 jlamarr22 closed this Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants