Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0525524
initial
apskhem Nov 13, 2025
da47677
feat: tmp setup
apskhem Nov 13, 2025
18fa6bb
feat: prepare test data
apskhem Nov 17, 2025
b475f96
chore: minor
apskhem Nov 17, 2025
aef5de2
Merge branch 'main' into test/setup-campaign
apskhem Nov 18, 2025
14fbd5d
chore: preparing minor
apskhem Nov 18, 2025
4e055f0
feat: apply json auto generate
apskhem Nov 18, 2025
c624f2e
feat: apply json auto generate
apskhem Nov 18, 2025
e9ede07
feat: general factory
apskhem Nov 20, 2025
e66d701
feat: campaign setup
apskhem Nov 20, 2025
29631a5
feat: minor rework
apskhem Nov 20, 2025
adf3ba0
feat: pre final
apskhem Nov 20, 2025
a3f3776
chore: fmt
apskhem Nov 20, 2025
ba9e6e1
chore: add jsf
apskhem Nov 20, 2025
e8d7305
chore: remove unused template
apskhem Nov 20, 2025
6ac97a0
chore: once fixture
apskhem Nov 20, 2025
24dff83
Merge branch 'main' into test/setup-campaign
apskhem Nov 20, 2025
6dd00a5
fix: factory calling
apskhem Nov 20, 2025
0095d95
chore: update lockfile
apskhem Nov 20, 2025
e79bce2
fix: comments
apskhem Nov 21, 2025
d11e1e4
Merge branch 'main' into test/setup-campaign
apskhem Nov 21, 2025
c92b493
chore: move metadata
apskhem Nov 24, 2025
2450adf
fix: type
apskhem Nov 24, 2025
ee59316
Merge branch 'main' into test/setup-campaign
apskhem Nov 24, 2025
e40ba73
chore: reorder fixtures
apskhem Nov 25, 2025
6a983fc
chore: reorder fixtures
apskhem Nov 25, 2025
31ca03f
fix: imports
apskhem Nov 25, 2025
d97ef57
fix: proposal form template metadata
apskhem Nov 25, 2025
ed546e3
fix: proposal form template id, ver, and params
apskhem Nov 25, 2025
a74331a
fix: proposal form template id, ver, and params
apskhem Nov 25, 2025
4a78380
feat: admin key setup initial
apskhem Nov 25, 2025
f6c03d6
feat: admin auth key
apskhem Nov 25, 2025
2b54cca
fix: cspell
apskhem Nov 25, 2025
126d534
Merge branch 'main' into test/setup-campaign
apskhem Nov 25, 2025
c576aa7
chore: minor builder clean up
apskhem Nov 26, 2025
26d4d03
chore: minor format
apskhem Nov 26, 2025
56a69ec
chore: minor format
apskhem Nov 26, 2025
fcb222f
chore: role id as param
apskhem Nov 26, 2025
a780dc9
Merge branch 'main' into test/setup-campaign
apskhem Nov 26, 2025
10db12a
chore: minor admin
apskhem Nov 26, 2025
8eeaddf
chore: admin cat-id
apskhem Nov 26, 2025
36924bc
Merge branch 'main' into test/setup-campaign
Mr-Leshiy Nov 27, 2025
006badd
test(cat-gateway): Prepare document submission in different types for…
Mr-Leshiy Nov 27, 2025
5bdaff8
replace JSF with ranjg
Mr-Leshiy Nov 27, 2025
59c49f8
fix spelling
Mr-Leshiy Nov 27, 2025
2fee793
chore: minor cleanup
apskhem Nov 27, 2025
a464b31
wip
Mr-Leshiy Nov 27, 2025
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
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ pyproject
pyright
pytest
qrcode
ranjg
rapidoc
ratelimit
redoc
Expand Down
5 changes: 2 additions & 3 deletions catalyst-gateway/bin/src/db/event/signed_docs/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ async fn filter_by_type(
}
}

/// Pre-seeded documents `f14.sql`, `f15.sql`, `old_format_signed_doc.sql` and
/// `test_signed_documents.sql`
const PRE_SEED_DATA: usize = 57;
/// Pre-seeded documents `f14.sql`, `f15.sql`, `old_format_signed_doc.sql`
const PRE_SEED_DATA: usize = 55;

async fn filter_all(docs: &[FullSignedDoc]) {
let filter = DocsQueryFilter::all();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,13 @@ impl VerifyingKeyProvider {
token: &mut CatalystRBACTokenV1,
kids: &[catalyst_signed_doc::CatalystId],
) -> anyhow::Result<Self> {
if kids.len() > 1 {
anyhow::bail!("Multi-signature document is currently unsupported");
}
use itertools::Itertools as _;

let [kid] = kids else {
anyhow::bail!("Multi-signature document is currently unsupported");
anyhow::bail!(
"Must have only one signature. Multi-signature document is currently unsupported. kids: [{}]",
kids.iter().map(ToString::to_string).join(",")
);
};

if kid != token.catalyst_id() {
Expand Down
3 changes: 3 additions & 0 deletions catalyst-gateway/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ services:
- CHAIN_NETWORK=Preprod
- SIGNED_DOC_SK=0x6455585b5dcc565c8975bc136e215d6d4dd96540620f37783c564da3cb3686dd
- INTERNAL_API_KEY=123
# cspell: disable
- SIGNED_DOC_ADMIN_KEYS=admin.catalyst://preprod.cardano/0KGVpkXVe5-h1RfIb08Mnc-xMZTzSX5VVnPDaHvhrqQ/0/10
# cspell: enable
# - LOG_LEVEL=error
# - RUST_LOG="error,cat_gateway=debug,cardano_chain_follower=debug,mithril-client=debug"
ports:
Expand Down
32 changes: 0 additions & 32 deletions catalyst-gateway/event-db/seed/test_signed_documents.sql

This file was deleted.

1 change: 1 addition & 0 deletions catalyst-gateway/tests/api_tests/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14.0rc1
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/api_tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.6.3 AS python-ci
IMPORT github.com/input-output-hk/catalyst-libs/rust:catalyst-signed-doc/v0.0.8 AS cat-libs-rust
IMPORT github.com/input-output-hk/catalyst-libs/rust:catalyst-signed-doc/v0.0.10 AS cat-libs-rust
IMPORT github.com/input-output-hk/catalyst-libs/rust:catalyst-signed-doc/v.0.0.4-fix-earthly-build AS dep-cat-libs-rust
IMPORT github.com/input-output-hk/catalyst-storage AS cat-storage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
from utils import uuid_v7
from api.v1 import document as document_v1
from api.v2 import document as document_v2
from utils.rbac_chain import rbac_chain_factory
from utils.rbac_chain import rbac_chain_factory, RoleID
from utils.admin import admin_key
from utils.signed_doc import (
proposal_doc_factory,
proposal_form_template_doc,
category_parameters_doc,
category_parameters_form_template_doc,
campaign_parameters_doc,
campaign_parameters_form_template_doc,
brand_parameters_doc,
brand_parameters_form_template_doc,
)


@pytest.mark.preprod_indexing
def test_document_put_and_get_endpoints(proposal_doc_factory, rbac_chain_factory):
(proposal_doc, role_id) = proposal_doc_factory()
rbac_chain = rbac_chain_factory()
role_id = RoleID.PROPOSER
proposal_doc = proposal_doc_factory(role_id)
(cat_id, sk_hex) = rbac_chain.cat_id_for_role(role_id)
proposal_doc_id = proposal_doc.metadata["id"]

Expand Down Expand Up @@ -55,7 +64,7 @@ def test_document_put_and_get_endpoints(proposal_doc_factory, rbac_chain_factory

# Put a non valid document with same ID different content
invalid_doc = proposal_doc.copy()
invalid_doc.content["setup"]["title"]["title"] = "another title"
invalid_doc.content["setup"]["title"] = {"title": "another title"}
resp = document_v1.put(
data=invalid_doc.build_and_sign(cat_id, sk_hex),
token=rbac_chain.auth_token(),
Expand All @@ -82,7 +91,8 @@ def test_document_index_endpoint(
proposal_doc_factory,
rbac_chain_factory,
):
(doc, role_id) = proposal_doc_factory()
role_id = RoleID.PROPOSER
doc = proposal_doc_factory(role_id)

rbac_chain = rbac_chain_factory()
(cat_id, sk_hex) = rbac_chain.cat_id_for_role(role_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def deprecated_proposal(rbac_chain):
"ver": "0194d490-30bf-7473-81c8-a0eaef369619",
},
}
with open("./test_data/signed_docs/proposal.json", "r") as json_file:
with open("./test_data/signed_docs/proposal.deprecated.json", "r") as json_file:
content = json.load(json_file)

doc = SignedDocumentV1(proposal_metadata_json, content)
Expand Down Expand Up @@ -300,7 +300,7 @@ def deprecated_comment(rbac_chain, proposal_id):
"ver": "0194d494-4402-7e0e-b8d6-171f8fea18b0",
},
}
with open("./test_data/signed_docs/comment.json", "r") as json_file:
with open("./test_data/signed_docs/comment.deprecated.json", "r") as json_file:
content = json.load(json_file)

doc = SignedDocumentV1(comment_metadata_json, content)
Expand All @@ -323,7 +323,7 @@ def deprecated_proposal_submission(rbac_chain, proposal_id):
"ver": proposal_id,
},
}
with open("./test_data/signed_docs/submission_action.json", "r") as json_file:
with open("./test_data/signed_docs/submission_action.deprecated.json", "r") as json_file:
content = json.load(json_file)

doc = SignedDocumentV1(sub_action_metadata_json, content)
Expand Down
Loading