Skip to content

Commit

Permalink
Fix incorrect calculation of micro_ccd_per_energy helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Feb 8, 2024
1 parent 6a79a56 commit 42e85df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased changes

## 4.1.1

- Fix incorrect calculation of the micro_ccd_per_eur helper.

## 4.1.0

- Add `ContractInitBuilder` for more ergonomic initialization of new smart
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "concordium-rust-sdk"
version = "4.1.0"
version = "4.1.1"
authors = ["Concordium <developers@concordium.com>"]
edition = "2021"
rust-version = "1.67"
Expand Down
6 changes: 3 additions & 3 deletions src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,23 +487,23 @@ impl ChainParameters {
let y = v0.euro_per_energy;
(
u128::from(x.numerator()) * u128::from(y.numerator()),
u128::from(y.denominator()) * u128::from(y.denominator()),
u128::from(x.denominator()) * u128::from(y.denominator()),
)
}
ChainParameters::V1(v1) => {
let x = v1.micro_ccd_per_euro;
let y = v1.euro_per_energy;
(
u128::from(x.numerator()) * u128::from(y.numerator()),
u128::from(y.denominator()) * u128::from(y.denominator()),
u128::from(x.denominator()) * u128::from(y.denominator()),
)
}
ChainParameters::V2(v2) => {
let x = v2.micro_ccd_per_euro;
let y = v2.euro_per_energy;
(
u128::from(x.numerator()) * u128::from(y.numerator()),
u128::from(y.denominator()) * u128::from(y.denominator()),
u128::from(x.denominator()) * u128::from(y.denominator()),
)
}
};
Expand Down

0 comments on commit 42e85df

Please sign in to comment.