Skip to content

Commit

Permalink
Format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Sep 20, 2024
1 parent d3e95bd commit e8cf43d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/uplc/src/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,9 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p1: {}", err))
})?;

Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
Err(de::Error::Message(
"BLS12-381 G1 points are not supported for flat decoding.".to_string(),
))
}

[10] => {
Expand All @@ -686,7 +688,9 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p2: {}", err))
})?;

Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
Err(de::Error::Message(
"BLS12-381 G2 points are not supported for flat decoding.".to_string(),
))
}
[11] => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(),
Expand Down Expand Up @@ -736,15 +740,19 @@ fn decode_constant_value(typ: Rc<Type>, d: &mut Decoder) -> Result<Constant, de:
let _p1 = blst::blst_p1::uncompress(&p1)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p1: {}", err)))?;

Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
Err(de::Error::Message(
"BLS12-381 G1 points are not supported for flat decoding.".to_string(),
))
}
Type::Bls12_381G2Element => {
let p2 = Vec::<u8>::decode(d)?;

let _p2 = blst::blst_p2::uncompress(&p2)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p2: {}", err)))?;

Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
Err(de::Error::Message(
"BLS12-381 G2 points are not supported for flat decoding.".to_string(),
))
}
Type::Bls12_381MlResult => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(),
Expand Down

0 comments on commit e8cf43d

Please sign in to comment.