Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

fix: base64 encoding for get last pending certificates #207

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/topos-sequencer-tce-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ tracing.workspace = true
uuid.workspace = true
tracing-opentelemetry.workspace = true
opentelemetry.workspace = true
base64.workspace = true

[dev-dependencies]
topos-tce-transport = { path = "../topos-tce-transport" }
topos-tce = { path = "../topos-tce" }
rstest = { workspace = true, features = ["async-timeout"] }
test-log.workspace = true
env_logger.workspace = true
base64.workspace = true
byteorder = "1.4.3"
dockertest = "0.3.1"
serial_test = "0.9"
Expand Down
3 changes: 2 additions & 1 deletion crates/topos-sequencer-tce-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//!

use crate::Error::InvalidChannelError;
use base64::Engine;
use opentelemetry::trace::FutureExt;
use std::collections::HashMap;
use tokio::sync::{mpsc, oneshot};
Expand Down Expand Up @@ -444,7 +445,7 @@ impl TceClientBuilder {
.into_iter()
.map(|(subnet_id, last_pending_certificate)| {
let subnet_id: SubnetId = TryInto::<SubnetId>::try_into(
hex::decode(&subnet_id[2..])
base64::engine::general_purpose::STANDARD.decode(subnet_id)
.map_err(|_| Error::InvalidSubnetId)?
.as_slice(),
)
Expand Down