Skip to content

Commit

Permalink
Bugfix: Remove unwrap in Consensus Param conversion (#2059)
Browse files Browse the repository at this point in the history
## 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?
  • Loading branch information
MitchTurner authored Aug 8, 2024
1 parent ecf5d23 commit 8621cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/client/src/client/schema/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ impl TryFrom<GasCosts> 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(),
Expand Down Expand Up @@ -418,6 +416,8 @@ impl TryFrom<GasCosts> 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(),
Expand Down

0 comments on commit 8621cf8

Please sign in to comment.