Skip to content

Commit 68a9216

Browse files
zees-devxgreenx
andauthored
DataSource struct attribute public visibility (#3134)
## Description This pull request makes a small change to the visibility of struct fields in the `DataSource` struct. The fields `data` and `stage` are now public, which allows them to be accessed from outside the module. Currently there is no way to override these attributes with custom values externally. This is required for FuelLabs/sway#7478 - as we override these attributes to enable contract state forking in the PR. ## Checklist - [ ] Breaking changes are clearly marked as such in the PR description and changelog - [ ] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [x] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Expose `DataSource` fields `data` and `stage` publicly and add corresponding changelog entry. > > - **State**: > - `crates/fuel-core/src/state/data_source.rs`: Make `DataSource` fields `data` and `stage` public. > - **Changelog**: > - `.changes/changed/3134.md`: Add entry noting public visibility of `DataSource` fields. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ab6b0e3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: z <[email protected]> Co-authored-by: Green Baneling <[email protected]>
1 parent cbd82a2 commit 68a9216

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.changes/changed/3134.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`stage` and `data` fields made public in `DataSource` struct.

crates/fuel-core/src/state/data_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub struct DataSource<Description, Stage>
2828
where
2929
Description: DatabaseDescription,
3030
{
31-
pub(crate) data: DataSourceType<Description>,
32-
pub(crate) stage: Stage,
31+
pub data: DataSourceType<Description>,
32+
pub stage: Stage,
3333
}
3434

3535
impl<Description, Stage> DataSource<Description, Stage>

0 commit comments

Comments
 (0)