Merge pull request #209 from matter-labs/feat/hex-serialization

feat(tee): use hex deserialization for RPC requests
This commit is contained in:
Harald Hoyer 2024-09-18 15:22:43 +02:00 committed by GitHub
commit 538782e1f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

1
Cargo.lock generated
View file

@ -5636,6 +5636,7 @@ dependencies = [
"reqwest 0.12.7",
"secp256k1 0.29.1",
"serde",
"serde_with 3.9.0",
"teepot",
"tokio",
"tracing",

View file

@ -16,6 +16,7 @@ jsonrpsee-types.workspace = true
reqwest.workspace = true
secp256k1.workspace = true
serde.workspace = true
serde_with = { workspace = true, features = ["hex"] }
teepot.workspace = true
tokio.workspace = true
tracing.workspace = true

View file

@ -5,6 +5,7 @@ use anyhow::{bail, Result};
use jsonrpsee_types::error::ErrorObject;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_with::{hex::Hex, serde_as};
use std::time::Duration;
use tokio::sync::watch;
use tracing::{error, warn};
@ -146,14 +147,19 @@ pub struct GetProofsResponse {
pub error: Option<ErrorObject<'static>>,
}
#[serde_as]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Proof {
pub l1_batch_number: u32,
pub tee_type: String,
#[serde_as(as = "Hex")]
pub pubkey: Vec<u8>,
#[serde_as(as = "Hex")]
pub signature: Vec<u8>,
#[serde_as(as = "Hex")]
pub proof: Vec<u8>,
pub proved_at: String,
#[serde_as(as = "Hex")]
pub attestation: Vec<u8>,
}