diff --git a/linera-base/src/data_types.rs b/linera-base/src/data_types.rs index 569492a0434..6496c4818fa 100644 --- a/linera-base/src/data_types.rs +++ b/linera-base/src/data_types.rs @@ -744,9 +744,17 @@ impl ApplicationPermissions { #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize)] pub enum OracleResponse { /// The response from a service query. - Service(#[debug(with = "hex_debug")] Vec), + Service( + #[debug(with = "hex_debug")] + #[serde(with = "serde_bytes")] + Vec, + ), /// The response from an HTTP POST request. - Post(#[debug(with = "hex_debug")] Vec), + Post( + #[debug(with = "hex_debug")] + #[serde(with = "serde_bytes")] + Vec, + ), /// A successful read or write of a blob. Blob(BlobId), /// An assertion oracle that passed. diff --git a/linera-chain/src/data_types.rs b/linera-chain/src/data_types.rs index b8b1a6a2b8c..39919bfb1a5 100644 --- a/linera-chain/src/data_types.rs +++ b/linera-chain/src/data_types.rs @@ -404,9 +404,11 @@ pub struct EventRecord { pub stream_id: StreamId, /// The event key. #[debug(with = "hex_debug")] + #[serde(with = "serde_bytes")] pub key: Vec, /// The payload data. #[debug(with = "hex_debug")] + #[serde(with = "serde_bytes")] pub value: Vec, } diff --git a/linera-rpc/tests/snapshots/format__format.yaml.snap b/linera-rpc/tests/snapshots/format__format.yaml.snap index b0a2ce9a6b0..f2df3e0324e 100644 --- a/linera-rpc/tests/snapshots/format__format.yaml.snap +++ b/linera-rpc/tests/snapshots/format__format.yaml.snap @@ -394,10 +394,8 @@ EventRecord: STRUCT: - stream_id: TYPENAME: StreamId - - key: - SEQ: U8 - - value: - SEQ: U8 + - key: BYTES + - value: BYTES ExecutedBlock: STRUCT: - block: @@ -635,12 +633,10 @@ OracleResponse: ENUM: 0: Service: - NEWTYPE: - SEQ: U8 + NEWTYPE: BYTES 1: Post: - NEWTYPE: - SEQ: U8 + NEWTYPE: BYTES 2: Blob: NEWTYPE: