diff --git a/Makefile b/Makefile index a39a4b2d..ac6f750a 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CARGO_HACK_ARGS=--feature-powerset --exclude-features default --group-features b CARGO_DOC_ARGS?=--open -XDRGEN_VERSION=c95a5bd7f9dff8dff53cadcef3014ceb69ab7088 +XDRGEN_VERSION=3f37191c1b26b39a4a8265a3824df6c3236cb120 # XDRGEN_LOCAL=1 XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12 XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12 diff --git a/src/curr/generated.rs b/src/curr/generated.rs index bb53ece6..f9c57ea9 100644 --- a/src/curr/generated.rs +++ b/src/curr/generated.rs @@ -1433,7 +1433,7 @@ impl schemars::JsonSchema for BytesM { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(MAX * 2), + max_length: MAX.checked_mul(2).map(Some).unwrap_or_default(), min_length: None, ..string }) @@ -10213,8 +10213,8 @@ impl schemars::JsonSchema for Thresholds { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -10775,8 +10775,8 @@ impl schemars::JsonSchema for AssetCode4 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -10907,8 +10907,8 @@ impl schemars::JsonSchema for AssetCode12 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(12 * 2), - min_length: Some(12 * 2), + max_length: 12_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 12_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -41162,8 +41162,8 @@ impl schemars::JsonSchema for Hash { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(32 * 2), - min_length: Some(32 * 2), + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -41311,8 +41311,8 @@ impl schemars::JsonSchema for Uint256 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(32 * 2), - min_length: Some(32 * 2), + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -42451,8 +42451,8 @@ impl schemars::JsonSchema for SignatureHint { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { diff --git a/src/next/generated.rs b/src/next/generated.rs index cd4325c0..d7a2201c 100644 --- a/src/next/generated.rs +++ b/src/next/generated.rs @@ -1433,7 +1433,7 @@ impl schemars::JsonSchema for BytesM { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(MAX * 2), + max_length: MAX.checked_mul(2).map(Some).unwrap_or_default(), min_length: None, ..string }) @@ -10213,8 +10213,8 @@ impl schemars::JsonSchema for Thresholds { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -10775,8 +10775,8 @@ impl schemars::JsonSchema for AssetCode4 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -10907,8 +10907,8 @@ impl schemars::JsonSchema for AssetCode12 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(12 * 2), - min_length: Some(12 * 2), + max_length: 12_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 12_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -41162,8 +41162,8 @@ impl schemars::JsonSchema for Hash { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(32 * 2), - min_length: Some(32 * 2), + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -41311,8 +41311,8 @@ impl schemars::JsonSchema for Uint256 { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(32 * 2), - min_length: Some(32 * 2), + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else { @@ -42451,8 +42451,8 @@ impl schemars::JsonSchema for SignatureHint { serde_json::Value::String("application/binary".to_string()), ); mut_string(schema.into(), |string| schemars::schema::StringValidation { - max_length: Some(4 * 2), - min_length: Some(4 * 2), + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), ..string }) } else {