Skip to content

Commit

Permalink
indirect flag for configurables (#29)
Browse files Browse the repository at this point in the history
This PR is part of FuelLabs/sway#6760 and it
allows the ABI json to inform if a configurable encoded bytes will be
load directly (at the predefined offset) or indirectly, there will
another offset at the predefined offset.

---------

Co-authored-by: hal3e <[email protected]>
  • Loading branch information
xunilrj and hal3e authored Jan 14, 2025
1 parent 3d8c4cc commit f099b9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/abi/full_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ pub struct FullConfigurable {
pub name: String,
pub application: FullTypeApplication,
pub offset: u64,
pub indirect: bool,
}

impl FullConfigurable {
Expand All @@ -271,6 +272,7 @@ impl FullConfigurable {
name: configurable.name.clone(),
application: FullTypeApplication::from_counterpart(&configurable.application, types),
offset: configurable.offset,
indirect: configurable.indirect,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/abi/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ pub struct Configurable {
pub name: String,
pub concrete_type_id: ConcreteTypeId,
pub offset: u64,
#[serde(default)]
pub indirect: bool,
}

#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand Down
2 changes: 2 additions & 0 deletions src/abi/unified_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ pub struct UnifiedConfigurable {
pub name: String,
pub application: UnifiedTypeApplication,
pub offset: u64,
pub indirect: bool,
}

impl UnifiedConfigurable {
Expand All @@ -384,6 +385,7 @@ impl UnifiedConfigurable {
concrete_types_lookup,
),
offset: configurable.offset,
indirect: configurable.indirect,
}
}
}
Expand Down

0 comments on commit f099b9d

Please sign in to comment.