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

MANAGER_LAMBDA.transferToContract: simplify generated lambda. #2404

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

sagotch
Copy link
Contributor

@sagotch sagotch commented Mar 23, 2023

MANAGER_LAMBDA.transferToContract produces instruction list which includes:

[{ prim: 'IF_NONE', args:[[[{ prim: 'UNIT' }, { prim: 'FAILWITH' }]] , [] ]}]

which is equivalent to

{ prim: 'IF_NONE', args:[[{ prim: 'UNIT' }, { prim: 'FAILWITH' }] , [] ]}

Old lambda generated

{ DROP ;
  NIL operation ;
  PUSH address "KT1FqCVKxbof2wRPxfLSRnMJfKH39Zh912AK" ;
  CONTRACT unit ;
  { IF_NONE { { UNIT ; FAILWITH } } {} } ;
  PUSH mutez 1 ;
  UNIT ;
  TRANSFER_TOKENS ;
  CONS }
Baker fee 0.000583 ꜩ
Storage fee 0.04575 ꜩ
Gas used 1,735 / 1,835 [94.6%]
Storage used 183 / 183 [100%]

New lambda generated

{ DROP ;
  NIL operation ;
  PUSH address "KT1FqCVKxbof2wRPxfLSRnMJfKH39Zh912AK" ;
  CONTRACT unit ;
  IF_NONE { UNIT ; FAILWITH } {} ;
  PUSH mutez 666000 ;
  UNIT ;
  TRANSFER_TOKENS ;
  CONS }
Baker fee 0.000575 ꜩ
Storage fee 0.04375 ꜩ
Gas used 1,732 / 1,832 [94.5%]
Storage used 175 / 175 [100%]

Once executed, the manually crafted lambda transfer tez as expected


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

@netlify
Copy link

netlify bot commented Mar 23, 2023

Deploy Preview for taquito-test-dapp ready!

Name Link
🔨 Latest commit 31d0cf0
🔍 Latest deploy log https://app.netlify.com/sites/taquito-test-dapp/deploys/64a6be30e5da0200084e9b68
😎 Deploy Preview https://deploy-preview-2404--taquito-test-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@claudebarde claudebarde self-requested a review April 7, 2023 15:56
@dsawali
Copy link
Contributor

dsawali commented Apr 14, 2023

Thanks for your contribution @sagotch. This should be a pretty useful update.

I will take a final look around next week. If everything looks good, we'll merge it then.

@dsawali
Copy link
Contributor

dsawali commented Apr 19, 2023

Hello @sagotch, the PR looks good but could you rebase with current master. Thank you!

@dsawali dsawali closed this Jul 10, 2023
@dsawali dsawali reopened this Jul 10, 2023
@dsawali dsawali merged commit 5e47743 into ecadlabs:master Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants