Skip to content
Closed
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
1 change: 1 addition & 0 deletions rust-src/concordium_base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
together with a request anchor is `verify_presentation_with_request_anchor`.
- Serialization derive macros `common::Serial`, `common::Deserial` and `common::Serialize` now supports
deriving serialization on enums.
- Derived `serde::Serialize` and `serde::Deserialize` on `cbor::value::Value`.

## 9.0.0 (2025-10-29)

Expand Down
2 changes: 1 addition & 1 deletion rust-src/concordium_base/src/common/cbor/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl CborSerialize for [u8] {
///
/// Notice that this serializes different from a plain `Vec<u8>` which
/// serializes to an array data item.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
#[derive(Debug, Clone, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)]
pub struct Bytes(pub Vec<u8>);

impl AsRef<[u8]> for Bytes {
Expand Down
2 changes: 1 addition & 1 deletion rust-src/concordium_base/src/common/cbor/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ciborium_ll::simple;

/// Generic CBOR data item that can represent
/// any data item type.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
Copy link
Contributor

@limemloh limemloh Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a very nice json representation of the CBOR, can we avoid implementing serde on the type here? It is not really clear how it behaves, so I would move it to the application to figure out and not have to deal with it in concordium-base.

Copy link
Contributor

@allanbrondum allanbrondum Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I don't think the CBOR value type here should be concerned with JSON serialization.

pub enum Value {
/// Positive integer (major type 0)
Positive(u64),
Expand Down