Skip to content

Commit 5f2e9f8

Browse files
committed
serialize camelcase
1 parent 5879b32 commit 5f2e9f8

File tree

1 file changed

+5
-2
lines changed
  • crates/wallets/src/wallet_browser

1 file changed

+5
-2
lines changed

crates/wallets/src/wallet_browser/types.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub(crate) struct BrowserTransactionResponse {
5757
}
5858

5959
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
60+
#[serde(deny_unknown_fields)]
6061
pub enum SignType {
6162
/// Standard personal sign: `eth_sign` / `personal_sign`
6263
PersonalSign,
@@ -65,6 +66,7 @@ pub enum SignType {
6566
}
6667

6768
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
69+
#[serde(deny_unknown_fields)]
6870
pub struct SignRequest {
6971
/// The message to be signed.
7072
pub message: String,
@@ -74,19 +76,19 @@ pub struct SignRequest {
7476

7577
/// Represents a signing request sent to the browser wallet.
7678
#[derive(Debug, Clone, Serialize, Deserialize)]
77-
#[serde(deny_unknown_fields)]
79+
#[serde(deny_unknown_fields, rename_all = "camelCase")]
7880
pub struct BrowserSignRequest {
7981
/// The unique identifier for the signing request.
8082
pub id: Uuid,
8183
/// The type of signing operation.
82-
#[serde(rename = "type")]
8384
pub sign_type: SignType,
8485
/// The sign request details.
8586
pub request: SignRequest,
8687
}
8788

8889
/// Represents a typed data signing request sent to the browser wallet.
8990
#[derive(Debug, Clone, Serialize, Deserialize)]
91+
#[serde(deny_unknown_fields, rename_all = "camelCase")]
9092
pub struct BrowserSignTypedDataRequest {
9193
/// The unique identifier for the signing request.
9294
pub id: Uuid,
@@ -98,6 +100,7 @@ pub struct BrowserSignTypedDataRequest {
98100

99101
/// Represents a signing response sent from the browser wallet.
100102
#[derive(Debug, Clone, Serialize, Deserialize)]
103+
#[serde(deny_unknown_fields)]
101104
pub(crate) struct BrowserSignResponse {
102105
/// The unique identifier for the signing request, must match the request ID sent earlier.
103106
pub id: Uuid,

0 commit comments

Comments
 (0)