Skip to content

Commit

Permalink
Update sdk-harness's configurables_in_contract test variable name f…
Browse files Browse the repository at this point in the history
…rom `CONTRACT_ID` to `MY_CONTRACT_ID` (#6167)

## Description

As described in #6137, the
`configurables_in_contract` test has a `ContractId` defined as
`CONTRACT_ID` in the configurable block. If `forc test` were to be run
on the sdk-harness, it would fail to compile.

Until the compiler explicitly disallows `CONTRACT_ID` in a configurable
block, this configurable has been changed to `MY_CONTRACT_ID`.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] 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.
- [x] 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.

Co-authored-by: IGI-111 <[email protected]>
  • Loading branch information
bitzoic and IGI-111 committed Jun 25, 2024
1 parent edebc4d commit 4608878
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async fn contract_configurables() -> Result<()> {
.with_STRUCT(new_struct.clone())?
.with_ENUM(new_enum.clone())?
.with_ADDRESS(new_address.clone())?
.with_CONTRACT_ID(new_contract_id.clone())?;
.with_MY_CONTRACT_ID(new_contract_id.clone())?;

let contract_id = Contract::load_from(
"test_projects/configurables_in_contract/out/release/configurables_in_contract.bin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ configurable {
},
ENUM: EnumWithGeneric<bool> = EnumWithGeneric::VariantOne(true),
ADDRESS: Address = Address::zero(),
CONTRACT_ID: ContractId = ContractId::zero(),
MY_CONTRACT_ID: ContractId = ContractId::zero(),
}

abi TestContract {
Expand All @@ -30,6 +30,6 @@ abi TestContract {

impl TestContract for Contract {
fn return_configurables() -> (u8, bool, [u32; 3], str[4], StructWithGeneric<u8>, EnumWithGeneric<bool>, Address, ContractId) {
(U8, BOOL, ARRAY, STR_4, STRUCT, ENUM, ADDRESS, CONTRACT_ID)
(U8, BOOL, ARRAY, STR_4, STRUCT, ENUM, ADDRESS, MY_CONTRACT_ID)
}
}

0 comments on commit 4608878

Please sign in to comment.