Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: the idx of a pair inside or inside pair is not calculated correctly #2929

Merged
merged 6 commits into from
May 2, 2024

Conversation

ac10n
Copy link
Contributor

@ac10n ac10n commented Apr 23, 2024

Closes #2927
Thank you for your contribution to Taquito.

Before submitting this PR, please make sure:

  • Your code builds cleanly without any errors or warnings
  • You have run the linter against the changes
  • You have added unit tests (if relevant/appropriate)
  • You have added integration tests (if relevant/appropriate)
  • All public methods or types have TypeDoc coverage with a complete description, and ideally an @example
  • You have added or updated corresponding documentation
  • If relevant, you have written a first draft summary describing the change for inclusion in Release Notes.

In this PR, please also make sure:

  • You have linked this PR to the issue by putting closes #TICKETNUMBER in the description box (when applicable)
  • You have added a concise description on your changes

Release Note Draft Snippet

This is a breaking change in (In API behaviour, not the API itself).
Previously, when Michelson Data was converted to javascript objects (For instance, by calling storage method of a contract abstraction), in the following scenario we would have an unexpected behaviour:

  1. The javascript representation has nested objects, like having a pair, inside an or inside another pair
  2. Some of the pair's items don't have annots.

In this case, the the resulting javascript object would look like this

{
  '0': 'firstValue',
  '1': 'secondValue,
  '2': {
   '2': 'thirdValue',
   '3': 'fourthValue'
  }

Please note the the inner object's field numbers depend on the object's location in it's parent, and starts with '2' in this example. With this PR, this changes to:

{
  '0': 'firstValue',
  '1': 'secondValue,
  '2': {
   '0': 'thirdValue',
   '1': 'fourthValue'
  }

If your dApp code depends on the old behaviour (or changing it requires too much effort, you can call Tezos.setFieldNumberingStrategy('Legacy') to keep thew previous behaviour. But please note that in a future release, this option might be removed.

Copy link

github-actions bot commented Apr 23, 2024

A new deploy preview is available on Cloudflare Pages at https://8ac783f0.taquito-test-dapp.pages.dev

Copy link

github-actions bot commented Apr 23, 2024

New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/.

Published packages:

npm i @taquito/beacon-wallet@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/contracts-library@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/utils@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/ledger-signer@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/taquito@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip12@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/core@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/sapling@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michel-codec@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/http-utils@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/local-forging@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/timelock@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/signer@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/rpc@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/remote-signer@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/michelson-encoder@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/
npm i @taquito/tzip16@19.2.0-68c006d-- --registry https://npm.preview.tezostaquito.io/

Copy link

cloudflare-workers-and-pages bot commented Apr 23, 2024

Deploying taquito with  Cloudflare Pages  Cloudflare Pages

Latest commit: c49e550
Status: ✅  Deploy successful!
Preview URL: https://133be780.taquito.pages.dev
Branch Preview URL: https://2927-variant-typing-bug.taquito.pages.dev

View logs

ac10n added 6 commits May 2, 2024 15:42
* feat: option for the user to choose between legacy and updated field numbering

* chore: fix typo

* chore: add typedoc comments for Token.fieldNumberingStrategy

* test: fix failing integration test
@ac10n ac10n merged commit 55f6772 into master May 2, 2024
10 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variant typing is not right when calling .storage() function
2 participants