Deduplicate code

This commit is contained in:
Niels Mündler
2023-12-18 14:55:19 +01:00
committed by Lucas
parent ba76c1d2cf
commit 89e518f878
3 changed files with 7 additions and 20 deletions

View File

@@ -398,9 +398,7 @@ pub fn from_pallas_bigint(n: &pallas::BigInt) -> BigInt {
match n {
pallas::BigInt::Int(i) => i128::from(*i).into(),
pallas::BigInt::BigUInt(bytes) => BigInt::from_bytes_be(num_bigint::Sign::Plus, bytes),
pallas::BigInt::BigNInt(bytes) => {
BigInt::from_bytes_be(num_bigint::Sign::Minus, bytes) - 1
},
pallas::BigInt::BigNInt(bytes) => BigInt::from_bytes_be(num_bigint::Sign::Minus, bytes) - 1,
}
}