Skip to content

Commit

Permalink
Test for contract address being a complex expression (#6495)
Browse files Browse the repository at this point in the history
## Description

This PR improves tests for #6490.
Now we have one contract test where the contract address comes from a
complex expression.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
  • Loading branch information
xunilrj authored Sep 5, 2024
1 parent cd95cdc commit de242ad
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ const CONTRACT_ID = 0x14ed3cd06c2947248f69d54bfa681fe40d26267be84df7e19e253622b7
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xf9f1fec713b977865880637fc24e58cda9e69f6e711ed8e5efe7de9ce51c88ec; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release

fn get_address() -> Option<std::address::Address> {
Some(CONTRACT_ID.into())
}

fn main() -> u64 {
let addr = abi(TestContract, CONTRACT_ID);
// Test address being a complex expression
let addr = abi(TestContract, get_address().unwrap().into());

let input = [Wrapper {
id: Id {
Expand Down

0 comments on commit de242ad

Please sign in to comment.