Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Feb 24, 2025
1 parent d739fac commit f89e1ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/astria-core/src/connect/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ pub mod v2 {
#[test]
fn can_parse_negative_price() {
let price = "-1".parse::<Price>().unwrap();
assert_eq!(price.get(), -1);
assert_eq!(price, Price::new(-1));
}
}
}
5 changes: 5 additions & 0 deletions crates/astria-core/src/primitive/v1/i128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ mod tests {
let actual: i128 = pb.into();
assert_eq!(expected, actual);
}

#[test]
fn i128_roundtrips_work() {
i128_roundtrip_check(0i128);
Expand All @@ -49,5 +50,9 @@ mod tests {
i128_roundtrip_check(1i128 << 127);
i128_roundtrip_check((1i128 << 127) + (1i128 << 63));
i128_roundtrip_check(i128::MAX);
i128_roundtrip_check(i128::MIN);
i128_roundtrip_check(-1i128);
i128_roundtrip_check(-i128::from(u64::MAX));
i128_roundtrip_check(-i128::from(u64::MAX) - 1i128);
}
}
2 changes: 1 addition & 1 deletion crates/astria-sequencer/src/app/tests_app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ async fn app_oracle_price_update_events_in_finalize_block() {
app.commit(storage.clone()).await;

let mut prices = std::collections::BTreeMap::new();
let price = Price::new(10000u128);
let price = Price::new(10000i128);
let price_bytes = price.get().to_be_bytes().to_vec();
let id_to_currency_pair = indexmap::indexmap! {
id => CurrencyPairInfo{
Expand Down

0 comments on commit f89e1ee

Please sign in to comment.