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

SmartContracts: Pass the calls to Interpreter.execute/3 & create corresponding message #967

Conversation

bchamagne
Copy link
Member

@bchamagne bchamagne commented Mar 30, 2023

Description

Create a GetContractCalls message. Then refactor the Interpreter.execute/3 to have the calls as a parameter instead of doing some I/O from within the contract execution.

The Contract.get_calls() is actually not really necessary anymore and we could tell the users there is a calls global variable available.

I entirely removed the get_calls function from Legacy interpreter since it did not work at all anyway.
I also only added it for the action blocks since there are no use case to handle it in condition block.

This PR is based on the branch #963. We need to rebase it after the merge

Fixes #926

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit tests ✔️
Manual test (faucet smart contract): ✔️

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@bchamagne bchamagne added bug Something isn't working smart contracts Involve smart contracts labels Mar 30, 2023
@bchamagne bchamagne self-assigned this Mar 30, 2023
@bchamagne bchamagne linked an issue Apr 20, 2023 that may be closed by this pull request
@samuelmanzanera samuelmanzanera merged commit aa73ff5 into archethic-foundation:919-worker-handle-contract-crash Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working smart contracts Involve smart contracts
Projects
Status: Done 🍻
Development

Successfully merging this pull request may close these issues.

Smart Contracts: Contract.get_calls() should query the network
3 participants