diff --git a/packages/fuels-code-gen/src/program_bindings/custom_types.rs b/packages/fuels-code-gen/src/program_bindings/custom_types.rs
index 88af247e7f..0f11ca9986 100644
--- a/packages/fuels-code-gen/src/program_bindings/custom_types.rs
+++ b/packages/fuels-code-gen/src/program_bindings/custom_types.rs
@@ -101,7 +101,10 @@ fn is_type_sdk_provided(type_path: &TypePath) -> bool {
fn is_type_unused(type_path: &TypePath) -> bool {
let msg = "Known to be correct";
[
+ // TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked.
+ TypePath::new("RawBytes").expect(msg),
TypePath::new("std::vec::RawVec").expect(msg),
+ TypePath::new("std::bytes::RawBytes").expect(msg),
// TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked.
TypePath::new("RawVec").expect(msg),
]
diff --git a/packages/fuels-code-gen/src/program_bindings/resolved_type.rs b/packages/fuels-code-gen/src/program_bindings/resolved_type.rs
index f329b8795e..8f9cea6aee 100644
--- a/packages/fuels-code-gen/src/program_bindings/resolved_type.rs
+++ b/packages/fuels-code-gen/src/program_bindings/resolved_type.rs
@@ -74,6 +74,7 @@ impl TypeResolver {
Self::to_array,
Self::to_sized_ascii_string,
Self::to_tuple,
+ Self::to_bytes,
Self::to_raw_slice,
Self::to_custom_type,
];
@@ -110,6 +111,18 @@ impl TypeResolver {
}))
}
+ fn to_bytes(&self, type_application: &FullTypeApplication) -> Result