Skip to content

Commit b44644c

Browse files
authored
feat(cat-gateway): Bump cat-libs, Catalyst Signed Docs parameters field (#2574)
* bump cat-libs version * fix * try
1 parent b46436e commit b44644c

File tree

3 files changed

+15
-32
lines changed

3 files changed

+15
-32
lines changed

catalyst-gateway/bin/Cargo.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ repository.workspace = true
1515
workspace = true
1616

1717
[dependencies]
18-
cardano-chain-follower = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
19-
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
20-
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
21-
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
22-
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
23-
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250514-00" }
18+
cardano-chain-follower = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
19+
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
20+
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
21+
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
22+
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
23+
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250519-00" }
2424

2525
pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
2626
pallas-traverse = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
@@ -109,9 +109,6 @@ poem-openapi-derive = { version = "=5.1.4" }
109109
# Its a transitive dependency of the "poem-openapi-derive" crate,
110110
# but its breaks API after version "0.20.11".
111111
darling = { version = "=0.20.10" }
112-
# Its a transitive dependency of the "orx-concurrent-vec" crate,
113-
# but its breaks API after version "1.3.0".
114-
orx-iterable = { version = "=1.2.0" }
115112

116113
[dev-dependencies]
117114

@@ -120,4 +117,4 @@ build-info-build = "0.0.39"
120117

121118
[package.metadata.cargo-machete]
122119
# remove that after fixing issues with latest crates
123-
ignored = ["poem-openapi-derive", "darling", "orx-iterable"]
120+
ignored = ["poem-openapi-derive", "darling"]

catalyst-gateway/bin/src/service/api/documents/post_document_index_query/response.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,9 @@ pub(crate) struct IndexedDocumentVersion {
158158
/// Document Template Reference that matches the filter
159159
#[oai(skip_serializing_if_is_none)]
160160
pub template: Option<FilteredDocumentReference>,
161-
/// Document Brand Reference that matches the filter
162-
#[oai(skip_serializing_if_is_none)]
163-
pub brand: Option<FilteredDocumentReference>,
164-
/// Document Campaign Reference that matches the filter
165-
#[oai(skip_serializing_if_is_none)]
166-
pub campaign: Option<FilteredDocumentReference>,
167-
/// Document Category Reference that matches the filter
168-
#[oai(skip_serializing_if_is_none)]
169-
pub category: Option<FilteredDocumentReference>,
161+
/// Document Parameter Reference that matches the filter
162+
#[oai(rename = "doc_parameters", skip_serializing_if_is_none)]
163+
pub parameters: Option<FilteredDocumentReference>,
170164
}
171165

172166
impl Example for IndexedDocumentVersion {
@@ -177,9 +171,7 @@ impl Example for IndexedDocumentVersion {
177171
doc_ref: Some(DocumentReference::example().into()),
178172
reply: None,
179173
template: None,
180-
brand: None,
181-
campaign: None,
182-
category: None,
174+
parameters: None,
183175
}
184176
}
185177
}
@@ -256,17 +248,13 @@ impl TryFrom<SignedDocBody> for IndexedDocumentVersionDocumented {
256248
let mut doc_ref = None;
257249
let mut reply = None;
258250
let mut template = None;
259-
let mut brand = None;
260-
let mut campaign = None;
261-
let mut category = None;
251+
let mut parameters = None;
262252
if let Some(json_meta) = doc.metadata() {
263253
let meta: catalyst_signed_doc::ExtraFields = serde_json::from_value(json_meta.clone())?;
264254
doc_ref = meta.doc_ref().map(Into::into);
265255
reply = meta.reply().map(Into::into);
266256
template = meta.template().map(Into::into);
267-
brand = meta.brand_id().map(Into::into);
268-
campaign = meta.campaign_id().map(Into::into);
269-
category = meta.campaign_id().map(Into::into);
257+
parameters = meta.parameters().map(Into::into);
270258
}
271259

272260
Ok(IndexedDocumentVersionDocumented(IndexedDocumentVersion {
@@ -275,9 +263,7 @@ impl TryFrom<SignedDocBody> for IndexedDocumentVersionDocumented {
275263
doc_ref,
276264
reply,
277265
template,
278-
brand,
279-
campaign,
280-
category,
266+
parameters,
281267
}))
282268
}
283269
}

catalyst-gateway/tests/api_tests/integration/test_signed_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __proposal_doc_factory() -> tuple[SignedDocument, RoleID]:
9292
"ver": proposal_templates[0],
9393
},
9494
# referenced to the defined category id, comes from the 'templates/data.rs' file
95-
"category_id": {
95+
"parameters": {
9696
"id": category_id,
9797
"ver": category_id,
9898
},

0 commit comments

Comments
 (0)