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 support for multi-contract contract calls #143

Merged
merged 6 commits into from
Mar 9, 2022

Conversation

digorithm
Copy link
Member

@digorithm digorithm commented Mar 8, 2022

This PR enables users to call contracts that are calling other external contracts. It introduces a chain method .set_contracts(&[...]) to do so. Like this:

let response = my_contract
    .my_method(...)
    .set_contracts(&[another_contract_id]) // Add this to set the external contract
    .call()
    .await
    .unwrap();

Closes #59.

@digorithm digorithm self-assigned this Mar 8, 2022
@digorithm digorithm added the enhancement New feature or request label Mar 8, 2022
@digorithm digorithm marked this pull request as ready for review March 8, 2022 20:51

Here's a more concrete example:

```Rust
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why moving all these docs into The Fuels-rs Book is a good idea: you could have them as real files then just include them.

Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks

@digorithm digorithm merged commit 6f972b2 into master Mar 9, 2022
@digorithm digorithm deleted the rodrigo/multi-contract-calls branch March 9, 2022 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Enable passing in multiple contract IDs with a call
3 participants