Skip to content

Commit 9a64a14

Browse files
committed
Merge branch 'main' into 2091-map-proposal-elements-for-testing
2 parents c258fe5 + 32a6a06 commit 9a64a14

File tree

28 files changed

+342
-536
lines changed

28 files changed

+342
-536
lines changed

catalyst-gateway/bin/Cargo.toml

Lines changed: 6 additions & 6 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 = "r20250406-00" }
19-
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
20-
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
21-
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
22-
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
23-
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
18+
cardano-chain-follower = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-00" }
19+
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-00" }
20+
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-00" }
21+
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-00" }
22+
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-00" }
23+
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250413-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" }

catalyst-gateway/bin/src/service/api/documents/get_document.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ impl catalyst_signed_doc::providers::CatalystSignedDocumentProvider for DocProvi
6565
&self, doc_ref: &catalyst_signed_doc::DocumentRef,
6666
) -> anyhow::Result<Option<CatalystSignedDocument>> {
6767
let id = doc_ref.id.uuid();
68-
let ver = doc_ref.ver.map(|uuid| uuid.uuid());
69-
match get_document(&id, ver.as_ref()).await {
68+
let ver = doc_ref.ver.uuid();
69+
match get_document(&id, Some(&ver)).await {
7070
Ok(doc) => Ok(Some(doc)),
7171
Err(err) if err.is::<NotFoundError>() => Ok(None),
7272
Err(err) => Err(err),

catalyst-gateway/bin/src/service/api/documents/templates/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ use uuid::Uuid;
1212

1313
/// Catalyst brand ID.
1414
const BRAND_ID: &str = "0194cfcd-bddc-7bb3-b5e9-455168bd3ff7";
15+
/// Catalyst brand Version (same as ID).
16+
const BRAND_VERSION: &str = BRAND_ID;
1517

1618
/// Fund 14 Campaign ID.
1719
const CAMPAIGN_ID: &str = "0194cfcf-15a2-7e32-b559-386b93d0724e";
20+
/// Fund 14 Campaign Version (Same as ID).
21+
const CAMPAIGN_VERSION: &str = CAMPAIGN_ID;
1822

1923
/// A map of signed document templates to its ID.
2024
pub(crate) static TEMPLATES: LazyLock<Option<HashMap<Uuid, CatalystSignedDocument>>> =
@@ -96,11 +100,11 @@ fn build_signed_doc(data: &SignedDocData, sk: &SigningKey) -> (Uuid, CatalystSig
96100
"type": data.doc_type,
97101
"id": data.id,
98102
"ver": data.ver,
99-
"category_id": data.category_id.map(|v| serde_json::json!({"id": v})),
103+
"category_id": data.category_id.map(|v| serde_json::json!({"id": v, "ver": v })),
100104
"content-type": ContentType::Json.to_string(),
101105
"content-encoding": ContentEncoding::Brotli.to_string(),
102-
"campaign_id": {"id": CAMPAIGN_ID},
103-
"brand_id": {"id": BRAND_ID},
106+
"campaign_id": {"id": CAMPAIGN_ID, "ver": CAMPAIGN_VERSION},
107+
"brand_id": {"id": BRAND_ID, "ver": BRAND_VERSION},
104108
});
105109

106110
let kid = IdUri::new(KID_NETWORK, None, sk.verifying_key());

catalyst-gateway/bin/src/service/common/auth/rbac/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl CatalystRBACTokenV1 {
9696
return Err(anyhow!("Catalyst ID must have nonce"));
9797
}
9898
let (role, rotation) = catalyst_id.role_and_rotation();
99-
if role != RoleIndex::DEFAULT {
99+
if role != RoleIndex::ROLE_0 {
100100
return Err(anyhow!("Catalyst ID mustn't have role specified"));
101101
}
102102
if rotation != KeyRotation::DEFAULT {

catalyst-gateway/bin/src/service/common/types/document/doc_ref.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ pub(crate) struct DocumentReference {
204204
doc_id: DocumentId,
205205
/// Document Version
206206
#[oai(skip_serializing_if_is_none)]
207-
ver: Option<DocumentVer>,
207+
ver: DocumentVer,
208208
}
209209

210210
impl Example for DocumentReference {
211211
fn example() -> Self {
212212
Self {
213213
doc_id: DocumentId::example(),
214-
ver: Some(DocumentVer::example()),
214+
ver: DocumentVer::example(),
215215
}
216216
}
217217
}
@@ -220,7 +220,7 @@ impl From<catalyst_signed_doc::DocumentRef> for DocumentReference {
220220
fn from(value: catalyst_signed_doc::DocumentRef) -> Self {
221221
Self {
222222
doc_id: value.id.into(),
223-
ver: value.ver.map(Into::into),
223+
ver: value.ver.into(),
224224
}
225225
}
226226
}

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def proposal_doc_factory(proposal_templates, rbac_auth_token_factory):
7070
def __proposal_doc_factory() -> SignedDocument:
7171
rbac_auth_token = rbac_auth_token_factory()
7272
proposal_doc_id = uuid_v7.uuid_v7()
73+
category_id = "0194d490-30bf-7473-81c8-a0eaef369619"
7374
proposal_metadata_json = {
7475
"id": proposal_doc_id,
7576
"ver": proposal_doc_id,
@@ -78,9 +79,15 @@ def __proposal_doc_factory() -> SignedDocument:
7879
"content-type": "application/json",
7980
"content-encoding": "br",
8081
# referenced to the defined proposal template id, comes from the 'templates/data.rs' file
81-
"template": {"id": proposal_templates[0]},
82+
"template": {
83+
"id": proposal_templates[0],
84+
"ver": proposal_templates[0],
85+
},
8286
# referenced to the defined category id, comes from the 'templates/data.rs' file
83-
"category_id": {"id": "0194d490-30bf-7473-81c8-a0eaef369619"},
87+
"category_id": {
88+
"id": category_id,
89+
"ver": category_id,
90+
},
8491
}
8592
with open("./test_data/signed_docs/proposal.json", "r") as proposal_json_file:
8693
proposal_json = json.load(proposal_json_file)
@@ -112,8 +119,14 @@ def __comment_doc_factory() -> SignedDocument:
112119
"type": "b679ded3-0e7c-41ba-89f8-da62a17898ea",
113120
"content-type": "application/json",
114121
"content-encoding": "br",
115-
"ref": {"id": proposal_doc.metadata["id"]},
116-
"template": {"id": comment_templates[0]},
122+
"ref": {
123+
"id": proposal_doc.metadata["id"],
124+
"ver": proposal_doc.metadata["ver"],
125+
},
126+
"template": {
127+
"id": comment_templates[0],
128+
"ver": comment_templates[0],
129+
},
117130
}
118131
with open("./test_data/signed_docs/comment.json", "r") as comment_json_file:
119132
comment_json = json.load(comment_json_file)
@@ -145,7 +158,10 @@ def __submission_action_factory() -> SignedDocument:
145158
"type": "5e60e623-ad02-4a1b-a1ac-406db978ee48",
146159
"content-type": "application/json",
147160
"content-encoding": "br",
148-
"ref": {"id": proposal_doc.metadata["id"]},
161+
"ref": {
162+
"id": proposal_doc.metadata["id"],
163+
"ver": proposal_doc.metadata["ver"],
164+
},
149165
}
150166
with open(
151167
"./test_data/signed_docs/submission_action.json", "r"

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-14-keychain-final.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Locator, Page } from "@playwright/test";
22
import { OnboardingBasePage } from "../onboarding-base-page";
33
import { PasswordInputPanel } from "./step-13-password-input";
44

5-
export class KaychainFinalPanel {
5+
export class KeychainFinalPanel {
66
page: Page;
77
linkWalletAndRolesBtn: Locator;
88

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-15-link-wallet-info.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Locator, Page } from "@playwright/test";
2-
import { KaychainFinalPanel } from "./step-14-keychain-final";
2+
import { KeychainFinalPanel } from "./step-14-keychain-final";
33

44
export class LinkWalletInfoPanel {
55
page: Page
@@ -13,8 +13,8 @@ export class LinkWalletInfoPanel {
1313
}
1414

1515
async goto() {
16-
await new KaychainFinalPanel(this.page).goto();
17-
await new KaychainFinalPanel(this.page).clickLinkWalletAndRolesBtn();
16+
await new KeychainFinalPanel(this.page).goto();
17+
await new KeychainFinalPanel(this.page).clickLinkWalletAndRolesBtn();
1818
}
1919

2020
async clickChooseWalletBtn() {

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-2-base-profile-info.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { GetStartedPanel } from "../step-1-get-started";
33

44
export class BaseProfileInfoPanel {
55
page: Page;
6-
ceateYourBaseProfilebtn: Locator;
6+
createYourBaseProfileBtn: Locator;
77

88
constructor(page: Page) {
99
this.page = page;
10-
this.ceateYourBaseProfilebtn = page.getByRole("button", {
10+
this.createYourBaseProfileBtn = page.getByRole("button", {
1111
name: "CreateBaseProfileNext-test",
1212
});
1313
}
@@ -16,8 +16,8 @@ export class BaseProfileInfoPanel {
1616
await new GetStartedPanel(this.page).goto();
1717
await new GetStartedPanel(this.page).clickCreateNewCatalystKeychain();
1818
}
19-
19+
2020
async clickCreateBaseProfileBtn() {
21-
await this.ceateYourBaseProfilebtn.click();
21+
await this.createYourBaseProfileBtn.click();
2222
}
2323
}

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-5-base-profile-final.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { AcknowledgementsPanel } from "./step-4-acknowledgements";
33

44
export class BaseProfileFinalPanel {
55
page: Page;
6-
createYourCatalystKeychainbtn: Locator;
6+
createYourCatalystKeychainBtn: Locator;
77

88
constructor(page: Page) {
99
this.page = page;
10-
this.createYourCatalystKeychainbtn = page.getByRole("button", {
10+
this.createYourCatalystKeychainBtn = page.getByRole("button", {
1111
name: "CreateKeychain-test",
1212
});
1313
}
@@ -17,7 +17,7 @@ export class BaseProfileFinalPanel {
1717
await new AcknowledgementsPanel(this.page).clickNextButton();
1818
}
1919

20-
async clickCreateYourCatalystKeychainbtn() {
21-
await this.createYourCatalystKeychainbtn.click();
20+
async clickCreateYourCatalystKeychainBtn() {
21+
await this.createYourCatalystKeychainBtn.click();
2222
}
2323
}

0 commit comments

Comments
 (0)