Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typecheck from Schema output isn't boolean anymore #2742

Open
hui-an-yang opened this issue Nov 28, 2023 · 0 comments
Open

typecheck from Schema output isn't boolean anymore #2742

hui-an-yang opened this issue Nov 28, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@hui-an-yang
Copy link
Collaborator

hui-an-yang commented Nov 28, 2023

Description

Typecheck method in Schema class used to return true/false this behaviour has been changed in a previous refactor

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://tezostaquito.io/docs/michelson_encoder/#the-typecheck-method'
  2. Click on '.Run code'
  3. Scroll down to 'results'
  4. See error - results doesn't show false as stated in documentation but log uncaught error in console

Expected behavior
Typecheck is a publicly exported function in Schema class. Documentation of the Typecheck has defined it's output to be true/false now the behaviour is return undefined or throw error
Since the refactor of producing unexpected behaviour till discovery now has been 4m that I'll assume people don't use Typecheck method in their codebase (didn't break people's code) but was used as a util function to determine what to input for storage value.
I think Typecheck method should at least return true when checkout but when it comes to false whether if it's a better practice to throw error directly or console.log(error) and return false is up for discussion

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
the pr of the behaviour change to reference what typecheck used to be
https://github.com/ecadlabs/taquito/pull/2551/files#diff-d381c6954cea4e63fa67739ae43adcdc2246cd50ee465023d2a2be5d8bded4ed

@hui-an-yang hui-an-yang added the bug Something isn't working label Nov 28, 2023
@Innkst Innkst added this to the v17.6 milestone Nov 30, 2023
@hui-an-yang hui-an-yang removed this from the v17.6 milestone Mar 2, 2024
@hui-an-yang hui-an-yang added this to the v20+ milestone May 13, 2024
@hui-an-yang hui-an-yang modified the milestones: v20+, 21, v21, v20.1 Oct 2, 2024
@hui-an-yang hui-an-yang modified the milestones: v20.1, NEXT Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

2 participants