Skip to content
Draft
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
5 changes: 4 additions & 1 deletion src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub const XDR_FILES_SHA256: [(&str, &str); 13] = [
),
(
"xdr/Stellar-contract-spec.x",
"f0655f82e0a28a79e067c02f427cc709db1e4323a50c9b85f730f812b9612dbd",
"cf99fae0d9d977d47a83b868cb503948763195e9b326c7778c86070b764a3cbd",
),
(
"xdr/Stellar-contract.x",
Expand Down Expand Up @@ -5003,6 +5003,9 @@ pub use sc_meta_entry::*;
mod sc_spec_doc_limit;
#[allow(unused_imports)]
pub use sc_spec_doc_limit::*;
mod sc_spec_type_name_limit;
#[allow(unused_imports)]
pub use sc_spec_type_name_limit::*;
mod sc_spec_type;
#[allow(unused_imports)]
pub use sc_spec_type::*;
Expand Down
12 changes: 6 additions & 6 deletions src/generated/sc_spec_event_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::*;
/// {
/// string doc<SC_SPEC_DOC_LIMIT>;
/// string lib<80>;
/// SCSymbol name;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// SCSymbol prefixTopics<2>;
/// SCSpecEventParamV0 params<>;
/// SCSpecEventDataFormat dataFormat;
Expand All @@ -29,7 +29,7 @@ use super::*;
pub struct ScSpecEventV0 {
pub doc: StringM<1024>,
pub lib: StringM<80>,
pub name: ScSymbol,
pub name: StringM<256>,
pub prefix_topics: VecM<ScSymbol, 2>,
pub params: VecM<ScSpecEventParamV0>,
pub data_format: ScSpecEventDataFormat,
Expand All @@ -42,7 +42,7 @@ impl ReadXdr for ScSpecEventV0 {
Ok(Self {
doc: StringM::<1024>::read_xdr(r)?,
lib: StringM::<80>::read_xdr(r)?,
name: ScSymbol::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
prefix_topics: VecM::<ScSymbol, 2>::read_xdr(r)?,
params: VecM::<ScSpecEventParamV0>::read_xdr(r)?,
data_format: ScSpecEventDataFormat::read_xdr(r)?,
Expand Down Expand Up @@ -72,7 +72,7 @@ impl WriteXdr for ScSpecEventV0 {
pub struct ScSpecEventV0View<'a> {
pub doc: StringMView<'a, 1024>,
pub lib: StringMView<'a, 80>,
pub name: ScSymbolView<'a>,
pub name: StringMView<'a, 256>,
pub prefix_topics: VecMView<'a, ScSymbolView<'a>, 2>,
pub params: VecMView<'a, ScSpecEventParamV0View<'a>>,
pub data_format: ScSpecEventDataFormat,
Expand All @@ -85,7 +85,7 @@ impl From<&ScSpecEventV0View<'_>> for ScSpecEventV0 {
Self {
doc: v.doc.to_stringm(),
lib: v.lib.to_stringm(),
name: (&v.name).into(),
name: v.name.to_stringm(),
prefix_topics: v.prefix_topics.to_vecm_from(),
params: v.params.to_vecm_from(),
data_format: v.data_format,
Expand Down Expand Up @@ -124,7 +124,7 @@ impl ScSpecEventV0View<'_> {
w.enter_depth();
w.write_len_prefixed(self.doc.as_slice());
w.write_len_prefixed(self.lib.as_slice());
self.name.const_write_xdr(w);
w.write_len_prefixed(self.name.as_slice());
{
w.enter_depth();
let __s0 = self.prefix_topics.as_slice();
Expand Down
10 changes: 10 additions & 0 deletions src/generated/sc_spec_type_name_limit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[allow(unused_imports, clippy::wildcard_imports)]
use super::*;

/// ScSpecTypeNameLimit is an XDR Const defined as:
///
/// ```text
/// const SC_SPEC_TYPE_NAME_LIMIT = 256;
/// ```
///
pub const SC_SPEC_TYPE_NAME_LIMIT: u64 = 256;
8 changes: 4 additions & 4 deletions src/generated/sc_spec_type_udt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::*;
/// ```text
/// struct SCSpecTypeUDT
/// {
/// string name<60>;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// };
/// ```
///
Expand All @@ -22,15 +22,15 @@ use super::*;
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct ScSpecTypeUdt {
pub name: StringM<60>,
pub name: StringM<256>,
}

impl ReadXdr for ScSpecTypeUdt {
#[cfg(feature = "std")]
fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
r.with_limited_depth(|r| {
Ok(Self {
name: StringM::<60>::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
})
})
}
Expand All @@ -50,7 +50,7 @@ impl WriteXdr for ScSpecTypeUdt {
/// const contexts and convertible to the owned type via [`From`]/[`Into`].
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct ScSpecTypeUdtView<'a> {
pub name: StringMView<'a, 60>,
pub name: StringMView<'a, 256>,
}

#[cfg(feature = "alloc")]
Expand Down
8 changes: 4 additions & 4 deletions src/generated/sc_spec_udt_enum_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::*;
/// {
/// string doc<SC_SPEC_DOC_LIMIT>;
/// string lib<80>;
/// string name<60>;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// SCSpecUDTEnumCaseV0 cases<>;
/// };
/// ```
Expand All @@ -27,7 +27,7 @@ use super::*;
pub struct ScSpecUdtEnumV0 {
pub doc: StringM<1024>,
pub lib: StringM<80>,
pub name: StringM<60>,
pub name: StringM<256>,
pub cases: VecM<ScSpecUdtEnumCaseV0>,
}

Expand All @@ -38,7 +38,7 @@ impl ReadXdr for ScSpecUdtEnumV0 {
Ok(Self {
doc: StringM::<1024>::read_xdr(r)?,
lib: StringM::<80>::read_xdr(r)?,
name: StringM::<60>::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
cases: VecM::<ScSpecUdtEnumCaseV0>::read_xdr(r)?,
})
})
Expand All @@ -64,7 +64,7 @@ impl WriteXdr for ScSpecUdtEnumV0 {
pub struct ScSpecUdtEnumV0View<'a> {
pub doc: StringMView<'a, 1024>,
pub lib: StringMView<'a, 80>,
pub name: StringMView<'a, 60>,
pub name: StringMView<'a, 256>,
pub cases: VecMView<'a, ScSpecUdtEnumCaseV0View<'a>>,
}

Expand Down
8 changes: 4 additions & 4 deletions src/generated/sc_spec_udt_error_enum_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::*;
/// {
/// string doc<SC_SPEC_DOC_LIMIT>;
/// string lib<80>;
/// string name<60>;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// SCSpecUDTErrorEnumCaseV0 cases<>;
/// };
/// ```
Expand All @@ -27,7 +27,7 @@ use super::*;
pub struct ScSpecUdtErrorEnumV0 {
pub doc: StringM<1024>,
pub lib: StringM<80>,
pub name: StringM<60>,
pub name: StringM<256>,
pub cases: VecM<ScSpecUdtErrorEnumCaseV0>,
}

Expand All @@ -38,7 +38,7 @@ impl ReadXdr for ScSpecUdtErrorEnumV0 {
Ok(Self {
doc: StringM::<1024>::read_xdr(r)?,
lib: StringM::<80>::read_xdr(r)?,
name: StringM::<60>::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
cases: VecM::<ScSpecUdtErrorEnumCaseV0>::read_xdr(r)?,
})
})
Expand All @@ -64,7 +64,7 @@ impl WriteXdr for ScSpecUdtErrorEnumV0 {
pub struct ScSpecUdtErrorEnumV0View<'a> {
pub doc: StringMView<'a, 1024>,
pub lib: StringMView<'a, 80>,
pub name: StringMView<'a, 60>,
pub name: StringMView<'a, 256>,
pub cases: VecMView<'a, ScSpecUdtErrorEnumCaseV0View<'a>>,
}

Expand Down
8 changes: 4 additions & 4 deletions src/generated/sc_spec_udt_struct_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::*;
/// {
/// string doc<SC_SPEC_DOC_LIMIT>;
/// string lib<80>;
/// string name<60>;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// SCSpecUDTStructFieldV0 fields<>;
/// };
/// ```
Expand All @@ -27,7 +27,7 @@ use super::*;
pub struct ScSpecUdtStructV0 {
pub doc: StringM<1024>,
pub lib: StringM<80>,
pub name: StringM<60>,
pub name: StringM<256>,
pub fields: VecM<ScSpecUdtStructFieldV0>,
}

Expand All @@ -38,7 +38,7 @@ impl ReadXdr for ScSpecUdtStructV0 {
Ok(Self {
doc: StringM::<1024>::read_xdr(r)?,
lib: StringM::<80>::read_xdr(r)?,
name: StringM::<60>::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
fields: VecM::<ScSpecUdtStructFieldV0>::read_xdr(r)?,
})
})
Expand All @@ -64,7 +64,7 @@ impl WriteXdr for ScSpecUdtStructV0 {
pub struct ScSpecUdtStructV0View<'a> {
pub doc: StringMView<'a, 1024>,
pub lib: StringMView<'a, 80>,
pub name: StringMView<'a, 60>,
pub name: StringMView<'a, 256>,
pub fields: VecMView<'a, ScSpecUdtStructFieldV0View<'a>>,
}

Expand Down
8 changes: 4 additions & 4 deletions src/generated/sc_spec_udt_union_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::*;
/// {
/// string doc<SC_SPEC_DOC_LIMIT>;
/// string lib<80>;
/// string name<60>;
/// string name<SC_SPEC_TYPE_NAME_LIMIT>;
/// SCSpecUDTUnionCaseV0 cases<>;
/// };
/// ```
Expand All @@ -27,7 +27,7 @@ use super::*;
pub struct ScSpecUdtUnionV0 {
pub doc: StringM<1024>,
pub lib: StringM<80>,
pub name: StringM<60>,
pub name: StringM<256>,
pub cases: VecM<ScSpecUdtUnionCaseV0>,
}

Expand All @@ -38,7 +38,7 @@ impl ReadXdr for ScSpecUdtUnionV0 {
Ok(Self {
doc: StringM::<1024>::read_xdr(r)?,
lib: StringM::<80>::read_xdr(r)?,
name: StringM::<60>::read_xdr(r)?,
name: StringM::<256>::read_xdr(r)?,
cases: VecM::<ScSpecUdtUnionCaseV0>::read_xdr(r)?,
})
})
Expand All @@ -64,7 +64,7 @@ impl WriteXdr for ScSpecUdtUnionV0 {
pub struct ScSpecUdtUnionV0View<'a> {
pub doc: StringMView<'a, 1024>,
pub lib: StringMView<'a, 80>,
pub name: StringMView<'a, 60>,
pub name: StringMView<'a, 256>,
pub cases: VecMView<'a, ScSpecUdtUnionCaseV0View<'a>>,
}

Expand Down
2 changes: 1 addition & 1 deletion xdr
Submodule xdr updated 1 files
+12 −6 Stellar-contract-spec.x
35 changes: 21 additions & 14 deletions xdr-definitions-json/xdr.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"name": "xdr/Stellar-contract-spec.x",
"sha256": "f0655f82e0a28a79e067c02f427cc709db1e4323a50c9b85f730f812b9612dbd"
"sha256": "cf99fae0d9d977d47a83b868cb503948763195e9b326c7778c86070b764a3cbd"
},
{
"name": "xdr/Stellar-contract.x",
Expand Down Expand Up @@ -1893,6 +1893,13 @@
"source": "const SC_SPEC_DOC_LIMIT = 1024;",
"file_index": 4
},
{
"kind": "const",
"name": "SC_SPEC_TYPE_NAME_LIMIT",
"value": 256,
"source": "const SC_SPEC_TYPE_NAME_LIMIT = 256;",
"file_index": 4
},
{
"kind": "enum",
"name": "SCSpecType",
Expand Down Expand Up @@ -2124,14 +2131,14 @@
"kind": "struct",
"name": "SCSpecTypeUDT",
"fixed_size": null,
"source": "struct SCSpecTypeUDT\n{\n string name<60>;\n};",
"source": "struct SCSpecTypeUDT\n{\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n};",
"file_index": 4,
"fields": [
{
"name": "name",
"type": {
"kind": "string",
"max_size": 60
"max_size": 256
}
}
]
Expand Down Expand Up @@ -2358,7 +2365,7 @@
"kind": "struct",
"name": "SCSpecUDTStructV0",
"fixed_size": null,
"source": "struct SCSpecUDTStructV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<60>;\n SCSpecUDTStructFieldV0 fields<>;\n};",
"source": "struct SCSpecUDTStructV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n SCSpecUDTStructFieldV0 fields<>;\n};",
"file_index": 4,
"fields": [
{
Expand All @@ -2379,7 +2386,7 @@
"name": "name",
"type": {
"kind": "string",
"max_size": 60
"max_size": 256
}
},
{
Expand Down Expand Up @@ -2513,7 +2520,7 @@
"kind": "struct",
"name": "SCSpecUDTUnionV0",
"fixed_size": null,
"source": "struct SCSpecUDTUnionV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<60>;\n SCSpecUDTUnionCaseV0 cases<>;\n};",
"source": "struct SCSpecUDTUnionV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n SCSpecUDTUnionCaseV0 cases<>;\n};",
"file_index": 4,
"fields": [
{
Expand All @@ -2534,7 +2541,7 @@
"name": "name",
"type": {
"kind": "string",
"max_size": 60
"max_size": 256
}
},
{
Expand Down Expand Up @@ -2583,7 +2590,7 @@
"kind": "struct",
"name": "SCSpecUDTEnumV0",
"fixed_size": null,
"source": "struct SCSpecUDTEnumV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<60>;\n SCSpecUDTEnumCaseV0 cases<>;\n};",
"source": "struct SCSpecUDTEnumV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n SCSpecUDTEnumCaseV0 cases<>;\n};",
"file_index": 4,
"fields": [
{
Expand All @@ -2604,7 +2611,7 @@
"name": "name",
"type": {
"kind": "string",
"max_size": 60
"max_size": 256
}
},
{
Expand Down Expand Up @@ -2653,7 +2660,7 @@
"kind": "struct",
"name": "SCSpecUDTErrorEnumV0",
"fixed_size": null,
"source": "struct SCSpecUDTErrorEnumV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<60>;\n SCSpecUDTErrorEnumCaseV0 cases<>;\n};",
"source": "struct SCSpecUDTErrorEnumV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n SCSpecUDTErrorEnumCaseV0 cases<>;\n};",
"file_index": 4,
"fields": [
{
Expand All @@ -2674,7 +2681,7 @@
"name": "name",
"type": {
"kind": "string",
"max_size": 60
"max_size": 256
}
},
{
Expand Down Expand Up @@ -2842,7 +2849,7 @@
"kind": "struct",
"name": "SCSpecEventV0",
"fixed_size": null,
"source": "struct SCSpecEventV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n SCSymbol name;\n SCSymbol prefixTopics<2>;\n SCSpecEventParamV0 params<>;\n SCSpecEventDataFormat dataFormat;\n};",
"source": "struct SCSpecEventV0\n{\n string doc<SC_SPEC_DOC_LIMIT>;\n string lib<80>;\n string name<SC_SPEC_TYPE_NAME_LIMIT>;\n SCSymbol prefixTopics<2>;\n SCSpecEventParamV0 params<>;\n SCSpecEventDataFormat dataFormat;\n};",
"file_index": 4,
"fields": [
{
Expand All @@ -2862,8 +2869,8 @@
{
"name": "name",
"type": {
"kind": "ref",
"name": "SCSymbol"
"kind": "string",
"max_size": 256
}
},
{
Expand Down
Loading
Loading