From 8621cf850b4bbea25c65fc5f6857fcd53db819b7 Mon Sep 17 00:00:00 2001 From: Mitchell Turner Date: Wed, 7 Aug 2024 18:47:53 -0600 Subject: [PATCH] Bugfix: Remove unwrap in Consensus Param conversion (#2059) ## 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 - [ ] 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/) - [ ] [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) - [ ] Someone else? --- CHANGELOG.md | 3 +++ crates/client/src/client/schema/chain.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a8207fbfb6..ff5be5bb19a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Bug Fixes +- [2059](https://github.com/FuelLabs/fuel-core/pull/2059): Remove unwrap that is breaking backwards compatibility + ## [Version 0.32.0] ### Added diff --git a/crates/client/src/client/schema/chain.rs b/crates/client/src/client/schema/chain.rs index 4c0b3969a14..7cafc355543 100644 --- a/crates/client/src/client/schema/chain.rs +++ b/crates/client/src/client/schema/chain.rs @@ -337,8 +337,6 @@ impl TryFrom for fuel_core_types::fuel_tx::GasCosts { bhei: value.bhei.into(), bhsh: value.bhsh.into(), burn: value.burn.into(), - bldd: value.bldd.unwrap().into(), - bsiz: value.bsiz.unwrap().into(), cb: value.cb.into(), cfsi: value.cfsi.into(), div: value.div.into(), @@ -418,6 +416,8 @@ impl TryFrom for fuel_core_types::fuel_tx::GasCosts { xori: value.xori.into(), aloc: value.aloc_dependent_cost.into(), + bsiz: value.bsiz.map(Into::into).unwrap_or(fuel_core_types::fuel_tx::consensus_parameters::DependentCost::free()), + bldd: value.bldd.map(Into::into).unwrap_or(fuel_core_types::fuel_tx::consensus_parameters::DependentCost::free()), cfe: value.cfe.into(), cfei: value.cfei_dependent_cost.into(), call: value.call.into(),