Make raw protobuf types non-pub, update to prost 0.14

Co-authored-by: Rolfe Schmidt <141083381+rolfe-signal@users.noreply.github.com>
This commit is contained in:
Jordan Rose 2025-11-21 20:00:58 -08:00 committed by GitHub
parent ff78d035d9
commit d48aa6f158
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 91 additions and 77 deletions

View file

@ -12,7 +12,7 @@ mod tests {
#[bench]
fn add_epoch(b: &mut Bencher) {
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
.expect("should be valid");
let mut e: u64 = 0;
b.iter(|| {
@ -28,7 +28,7 @@ mod tests {
#[bench]
fn send_key(b: &mut Bencher) {
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
.expect("should be valid");
b.iter(|| {
// Inner closure, the actual test
@ -38,7 +38,7 @@ mod tests {
#[bench]
fn recv_key(b: &mut Bencher) {
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
.expect("should be valid");
let mut k: u32 = 0;
b.iter(|| {
@ -50,7 +50,7 @@ mod tests {
#[bench]
fn recv_skip_key(b: &mut Bencher) {
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
.expect("should be valid");
let mut k: u32 = 0;
b.iter(|| {
@ -63,7 +63,7 @@ mod tests {
#[bench]
fn recv_with_truncate(b: &mut Bencher) {
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
.expect("should be valid");
let mut k: u32 = 0;
b.iter(|| {

View file

@ -66,9 +66,9 @@ mod tests {
#[bench]
fn encoder_from_pb(b: &mut Bencher) {
let encoder = PolyEncoder::encode_bytes(&[3u8; 1088]).expect("encode_bytes");
let bytes = encoder.into_pb().encode_to_vec();
let bytes = encoder.into_pb_test().encode_to_vec();
b.iter(|| {
black_box(PolyEncoder::from_pb(
black_box(PolyEncoder::from_pb_test(
pqrpb::PolynomialEncoder::decode(bytes.as_slice()).unwrap(),
))
});
@ -82,9 +82,9 @@ mod tests {
for i in 1..chunks_needed {
decoder.add_chunk(&encoder.chunk_at(i));
}
let bytes = decoder.into_pb().encode_to_vec();
let bytes = decoder.into_pb_test().encode_to_vec();
b.iter(|| {
black_box(PolyDecoder::from_pb(
black_box(PolyDecoder::from_pb_test(
pqrpb::PolynomialDecoder::decode(bytes.as_slice()).unwrap(),
))
});