Back-merge v0.13 hotfix (#185)

This commit is contained in:
Santiago Carmuega 2022-09-11 16:01:02 -03:00 committed by GitHub
commit 070b33114f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 25 additions and 9 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-addresses"
description = "Ergonomic library to work with different Cardano addresses"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -821,4 +821,10 @@ mod tests {
assert_eq!(addr.to_bech32().unwrap(), MAINNET_TEST_VECTORS[0].0);
}
#[test]
fn test_minted_invalid_pointed_address() {
let addr = Address::from_hex("40C19D7D05E90EEB6394B53313FE79D47077DE33068C6B813BBE5C9D5681FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F81FFFFFFFFFFFFFFFF7F81FFFFFFFFFFFFFFFF7F");
assert!(matches!(addr, Ok(Address::Shelley(_))));
}
}

View file

@ -27,7 +27,14 @@ pub fn read(cursor: &mut Cursor<&[u8]>) -> Result<u64, Error> {
output = (output << 7) | (byte & 0x7F) as u128;
if output > u64::MAX.into() {
return Err(Error::VarUintOverflow);
// Strictly speaking, if we find a value above max u64, an overflow error should
// be returned. The problem is that testnet has some invalid address values
// somehow minted in valid blocks. The node and many explorers, instead of
// throwing an error, return max u64 as a workaround. We copy the same behavior
// to maintain homogeneity.
//
// return Err(Error::VarUintOverflow);
return Ok(u64::MAX);
}
if (byte & 0x80) == 0 {

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-codec"
description = "Pallas common CBOR encoding interface and utilities"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-crypto"
description = "Cryptographic primitives for Cardano"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-miniprotocols"
description = "Implementation of the Ouroboros network mini-protocols state-machines"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-multiplexer"
description = "Multithreaded Ouroboros multiplexer implementation using mpsc channels"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-primitives"
description = "Ledger primitives and cbor codec for the different Cardano eras"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1469,6 +1469,8 @@ mod tests {
include_str!("../../../test_data/alonzo22.block"),
// peculiar block with indef byte array in plutus data
include_str!("../../../test_data/alonzo23.block"),
// peculiar block with invalid address (pointer overflow)
include_str!("../../../test_data/alonzo27.block"),
];
for (idx, block_str) in test_blocks.iter().enumerate() {

View file

@ -1,7 +1,7 @@
[package]
name = "pallas-traverse"
description = "Utilities to traverse over multi-era block data"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

View file

@ -1,7 +1,7 @@
[package]
name = "pallas"
description = "Rust-native building blocks for the Cardano blockchain ecosystem."
version = "0.13.1"
version = "0.13.2"
edition = "2021"
repository = "https://github.com/txpipe/pallas"
homepage = "https://github.com/txpipe/pallas"

1
test_data/alonzo27.block Normal file

File diff suppressed because one or more lines are too long