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

Adding configurables breaks contracts | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 #1475

Open
DefiCake opened this issue Aug 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@DefiCake
Copy link
Member

DefiCake commented Aug 1, 2024

Reproduction: https://github.com/DefiCake/fuels-rs-65-configurables-issue
To run: forc build && cargo test

All transactions to a contract that has been initialized with configurables seem to fail. In the reproduction you can see that I am trying to call a pure function _proxy_pure_fn that is supposed to return 255.

Function definition:
https://github.com/DefiCake/fuels-rs-65-configurables-issue/blob/db85be605137a197d9979dc8b401b35a5839c443/src/main.sw#L103

Call in the tests:
https://github.com/DefiCake/fuels-rs-65-configurables-issue/blob/db85be605137a197d9979dc8b401b35a5839c443/tests/harness.rs#L131

In the test file, there are two functions test_with_configurables and test_without_configurables whose only difference is:

let configurables = MyContractConfigurables::default()
            .with_INITIAL_OWNER(State::Initialized(wallet.address().into()))
            .unwrap()
            .with_INITIAL_TARGET(
                ContractId::from_str(
                    "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
                ).unwrap()
            )
            .unwrap();

// With configurables:
let load_configuration = LoadConfiguration::default().with_configurables(configurables);
// Without configurables:
let load_configuration = LoadConfiguration::default();

UPDATE. It seems the issue revolves around

.with_INITIAL_TARGET(
    ContractId::from_str(
        "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
    ).unwrap()
)

Removing this specific configurable also makes the test pass

@DefiCake DefiCake changed the title Adding configurables botch the contract | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 Adding configurables breaks contracts | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 Aug 1, 2024
@hal3e hal3e self-assigned this Aug 5, 2024
@hal3e hal3e added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants