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

Add Contract.call_function in SC language #1248

Merged

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Sep 1, 2023

Description

Add a new function in Contract module in SC library to allow user to call a public function from a contract

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Unit test
Manuel testing with those contract

@version 1
export fun add(x, y) do
  x + y
end
@version 1
condition transaction: []
actions triggered_by: transaction do
  address = 0x0000c32fd6b33c9ff557ad8826f516c1c81d0242524be10891a009b77c50e252bcc5
  res = Contract.call_function(address, "add", [1, 2])
  Contract.set_content res
end

triggered second contract and result transaction contained 3 in content

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

@Neylix Neylix added feature New feature request smart contracts Involve smart contracts labels Sep 1, 2023
@Neylix Neylix requested a review from bchamagne September 1, 2023 13:59
@Neylix Neylix force-pushed the Add-Contract.call_function branch from 321c075 to a8cab88 Compare September 1, 2023 14:13
@Neylix Neylix merged commit 4e7a438 into archethic-foundation:develop Sep 1, 2023
@Neylix Neylix deleted the Add-Contract.call_function branch September 1, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request smart contracts Involve smart contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants