Skip to content

Commit fc84063

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

File tree

28 files changed

+328
-518
lines changed

28 files changed

+328
-518
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
}

catalyst_voices/apps/voices/e2e_tests/pageobject/onboarding/create-flow/step-6-catalyst-keychain-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class CatalystKeychainInfoPanel {
1616
await new BaseProfileFinalPanel(this.page).goto();
1717
await new BaseProfileFinalPanel(
1818
this.page
19-
).clickCreateYourCatalystKeychainbtn();
19+
).clickCreateYourCatalystKeychainBtn();
2020
}
2121

2222
async clickCreateCatalystKeychainNowBtn() {
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { test, expect, type Locator, type Page } from "@playwright/test";
1+
import { type Locator, type Page } from "@playwright/test";
22

33
export class OnboardingBasePage {
4-
page: Page;
5-
nextBtnGroup: Locator;
6-
nextButton: Locator;
7-
setUnlockPasswordGroup: Locator;
8-
setUnlockPasswordBtn: Locator;
9-
password: string;
4+
page: Page;
5+
nextBtnGroup: Locator;
6+
nextButton: Locator;
7+
setUnlockPasswordGroup: Locator;
8+
setUnlockPasswordBtn: Locator;
9+
password: string;
1010

11-
constructor(page:Page) {
12-
this.page = page;
13-
this.nextBtnGroup = page.getByRole("group", { name: "NextButton-test" });
14-
this.nextButton = this.nextBtnGroup.locator('role=button[name="Next"]');
15-
this.setUnlockPasswordGroup = page.getByRole("group", {
16-
name: "SetUnlockPasswordButton",
17-
});
18-
this.setUnlockPasswordBtn = this.setUnlockPasswordGroup.locator("role=button");
19-
this.password = "bera1234";
20-
}
21-
22-
}
11+
constructor(page: Page) {
12+
this.page = page;
13+
this.nextBtnGroup = page.getByRole("group", { name: "NextButton-test" });
14+
this.nextButton = this.nextBtnGroup.locator('role=button[name="Next"]');
15+
this.setUnlockPasswordGroup = page.getByRole("group", {
16+
name: "SetUnlockPasswordButton",
17+
});
18+
this.setUnlockPasswordBtn =
19+
this.setUnlockPasswordGroup.locator("role=button");
20+
this.password = "emiride1234";
21+
}
22+
}

catalyst_voices/apps/voices/e2e_tests/tests/onboarding.spec.ts

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -42,118 +42,3 @@ test("Refactored restore flow demo", async ({ page }) => {
4242
test("Refactored create flow demo", async ({ page }) => {
4343
await new WalletListPanel(page).goto();
4444
});
45-
46-
// test("Restore flow demo", async ({ page }) => {
47-
// const nextBtnGroup = page.getByRole("group", { name: "NextButton-test" });
48-
// const nextButton = nextBtnGroup.locator('role=button[name="Next"]');
49-
// const setUnlockPasswordGroup = page.getByRole("group", {
50-
// name: "SetUnlockPasswordButton",
51-
// });
52-
// const setUnlockPasswordBtn = setUnlockPasswordGroup.locator("role=button");
53-
// const password = "bera1234";
54-
55-
// await page.getByRole("button", { name: "GetStartedButton-test" }).click();
56-
// await page
57-
// .getByRole("group", {
58-
// name: "Recover your Catalyst Keychain On this device",
59-
// })
60-
// .click();
61-
// await page
62-
// .getByRole("group", {
63-
// name: "Restore seedphrase Restore/Upload with 12-word seed phrase",
64-
// })
65-
// .click();
66-
// await nextButton.click();
67-
// await nextButton.click();
68-
69-
// //Wait for the set unlock password button to be enabled
70-
// const setUnlockPasswordBtnIsDisabled =
71-
// await setUnlockPasswordBtn.getAttribute("aria-disabled");
72-
// if (setUnlockPasswordBtnIsDisabled === "true") {
73-
// await setUnlockPasswordBtn.waitFor({
74-
// state: "visible",
75-
// timeout: 5000,
76-
// });
77-
// }
78-
// await setUnlockPasswordBtn.click();
79-
// await nextButton.click();
80-
81-
// await page
82-
// .locator('role=group[name="Enter password"] >> role=textbox')
83-
// .fill(password);
84-
// await page
85-
// .locator('role=group[name="Confirm password"] >> role=textbox')
86-
// .click();
87-
// await page
88-
// .locator('role=group[name="Confirm password"] >> role=textbox')
89-
// .fill(password);
90-
91-
// //Wait for the next button to be enabled
92-
// const nextBtnIsDisabled = await nextButton.getAttribute("aria-disabled");
93-
// if (nextBtnIsDisabled === "true") {
94-
// await nextButton.waitFor({
95-
// state: "visible",
96-
// timeout: 5000,
97-
// });
98-
// }
99-
// await nextButton.click();
100-
// await page.locator('role=button[name="Go to account"]').click();
101-
// await page.locator('role=button[name="RemoveKeychainButton"]').click();
102-
// await page.getByLabel("VoicesTextField Enter phrase").fill("Remove Keychain");
103-
// await page.waitForTimeout(200);
104-
// await page
105-
// .getByRole("button", { name: "DeleteKeychainContinueButton" })
106-
// .click();
107-
// await page.getByRole("button", { name: "closebtn-test" }).click();
108-
// });
109-
110-
// test("Create flow demo", async ({ page }) => {
111-
// const nextBtnGroup = page.getByRole("group", { name: "NextButton-test" });
112-
// const nextButton = nextBtnGroup.locator('role=button[name="Next"]');
113-
// const checkbox = page.getByRole("checkbox");
114-
// const setUnlockPasswordGroup = page.getByRole("group", {
115-
// name: "SetUnlockPasswordButton",
116-
// });
117-
// const setUnlockPasswordBtn = setUnlockPasswordGroup.locator("role=button");
118-
// const password = "bera1234";
119-
120-
// await page.getByRole("button", { name: "GetStartedButton-test" }).click();
121-
// await page
122-
// .getByRole("group", {
123-
// name: "Create a new Catalyst Keychain On this device",
124-
// })
125-
// .click();
126-
// await page
127-
// .getByRole("button", {
128-
// name: "CreateBaseProfileNext-test",
129-
// })
130-
// .click();
131-
// await nextButton.click();
132-
// await nextButton.click();
133-
// await page.getByRole("button", { name: "CreateKeychain-test" }).click();
134-
// await page.getByRole("button", { name: "CreateKeychainNow-test" }).click();
135-
// await nextButton.click();
136-
// const checkboxIsChecked = await checkbox.getAttribute("aria-checked");
137-
// if (checkboxIsChecked === "false") {
138-
// await checkbox.click();
139-
// }
140-
// await nextButton.click();
141-
// await nextButton.click();
142-
// await nextButton.click();
143-
// await nextButton.click();
144-
// await nextButton.click();
145-
146-
// await page
147-
// .locator('role=group[name="Enter password"] >> role=textbox')
148-
// .fill(password);
149-
// await page.waitForTimeout(1200);
150-
// await page
151-
// .locator('role=group[name="Confirm password"] >> role=textbox')
152-
// .click();
153-
// await page
154-
// .locator('role=group[name="Confirm password"] >> role=textbox')
155-
// .fill(password);
156-
// await nextButton.click();
157-
// await page.getByRole("button", { name: "LinkWalletAndRoles-test" }).click();
158-
// await page.getByRole("button", { name: "closebtn-test" }).click();
159-
// });

0 commit comments

Comments
 (0)