Skip to content

Commit 313b638

Browse files
feat(rust/signed-doc): Catalyst Signed Documents validation initialisation fully during the runtime (#547)
* added new catalyst-signed-doc-spec crate * wip * add versions check * fix * fix * fix spelling * fix clippy * wip * cleanup * wip * wip * wip * feat(rust/signed-doc): generate content encoding rules from macro * cleanup --------- Co-authored-by: Joaquín Rosales <joaquin.rosales@iohk.io>
1 parent 6e806ce commit 313b638

File tree

27 files changed

+408
-388
lines changed

27 files changed

+408
-388
lines changed

rust/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ members = [
1616
"vote-tx-v2",
1717
"signed_doc",
1818
"catalyst-signed-doc-macro",
19+
"catalyst-signed-doc-spec",
1920
"rbac-registration",
2021
]
2122

rust/Earthfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ COPY_SRC:
1818
hermes-ipfs \
1919
signed_doc \
2020
catalyst-signed-doc-macro \
21+
catalyst-signed-doc-spec \
2122
rbac-registration \
2223
immutable-ledger .
2324

@@ -73,6 +74,7 @@ build:
7374
--libs=rbac-registration \
7475
--libs=catalyst-signed-doc \
7576
--libs=catalyst-signed-doc-macro \
77+
--libs=catalyst-signed-doc-spec \
7678
--bins=cbork/cbork
7779

7880
LET ARCH=$(uname -m)

rust/catalyst-signed-doc-macro/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ proc-macro = true
1717
syn = { version = "2.0", features = ["full"] }
1818
quote = "1.0"
1919
proc-macro2 = "1.0"
20-
serde_json = "1.0.142"
2120
anyhow = "1.0.99"
22-
Inflector = "0.11.4"
23-
serde = { version = "1.0.219", features = ["derive"] }
21+
22+
catalyst-signed-doc-spec = { version = "0.1.3", path = "../catalyst-signed-doc-spec" }
23+

rust/catalyst-signed-doc-macro/src/lib.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//! spec.
33
44
mod error;
5-
mod rules;
6-
mod signed_doc_spec;
75
mod types_consts;
86

97
use crate::error::process_error;
@@ -25,17 +23,3 @@ pub fn catalyst_signed_documents_types_consts(
2523
.unwrap_or_else(process_error)
2624
.into()
2725
}
28-
29-
/// Defines `documents_rules` function which will return a defined
30-
/// `catalyst_signed_doc::Rules` instances for each corresponding document type, which are
31-
/// defined inside the `signed_doc.json` spec.
32-
///
33-
/// ```ignore
34-
/// fn documents_rules() -> impl Iterator<Item = (DocType, Rules)>
35-
/// ```
36-
#[proc_macro]
37-
pub fn catalyst_signed_documents_rules(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
38-
rules::catalyst_signed_documents_rules_impl()
39-
.unwrap_or_else(process_error)
40-
.into()
41-
}

rust/catalyst-signed-doc-macro/src/rules/content_type.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.

rust/catalyst-signed-doc-macro/src/rules/doc_ref.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

rust/catalyst-signed-doc-macro/src/rules/mod.rs

Lines changed: 0 additions & 60 deletions
This file was deleted.

rust/catalyst-signed-doc-macro/src/signed_doc_spec/doc_ref.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)