Skip to content

Commit b9ef5c3

Browse files
authored
feat(general): Bump catalyst-ci (#226)
* bump cat-ci ver * fix rust-toolchain * fix deny.toml * get rid of the base64ct fix * try * add TryFrom<&[u8]> and TryInto<Vec<u8>> impl for CatalystSignedDocument struct * update test
1 parent bab4713 commit b9ef5c3

File tree

12 files changed

+28
-19
lines changed

12 files changed

+28
-19
lines changed

Earthfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.27 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.27 AS cspell-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.3.0 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.3.0 AS cspell-ci
55

66

77
FROM debian:stable-slim

docs/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.27 AS docs-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.3.0 AS docs-ci
44

55

66
IMPORT .. AS repo

docs/src/architecture/08_concepts/catalyst_voting/cddl/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.2.27 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.3.0 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

docs/src/architecture/08_concepts/immutable_ledger/cddl/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.2.27 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.3.0 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

docs/src/architecture/08_concepts/signed_doc/cddl/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.2.27 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.3.0 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

rust/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.37 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.3.0 AS rust-ci
44

55
COPY_SRC:
66
FUNCTION

rust/c509-certificate/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.27 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.3.0 AS rust-ci
44

55

66
IMPORT .. AS rust-local

rust/catalyst-voting/Cargo.toml

-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ rand_core = { version = "0.6.4", features = ["getrandom"] }
2222
rand_chacha = "0.3.1"
2323
curve25519-dalek = { version = "4.1.3", features = ["digest", "rand_core"] }
2424
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
25-
# Its a transitive dependency which fails to build on higher version with our current compiler 1.83
26-
base64ct = { version = "=1.6.0" }
2725
blake2b_simd = "1.0.2"
2826
rayon = "1.10.0"
2927

@@ -33,7 +31,3 @@ proptest = { version = "1.5.0" }
3331
# Potentially it could be replaced with using `proptest::property_test` attribute macro,
3432
# after this PR will be merged https://github.com/proptest-rs/proptest/pull/523
3533
test-strategy = "0.4.0"
36-
37-
[package.metadata.cargo-machete]
38-
# remove that after fixing issues with latest crates
39-
ignored = ["base64ct"]

rust/deny.toml

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ allow-git = [
5858
"https://github.com/txpipe/kes",
5959
"https://github.com/txpipe/curve25519-dalek",
6060
"https://github.com/input-output-hk/mithril",
61-
"https://github.com/orxfun/orx-pseudo-default",
6261
]
6362

6463
[licenses]

rust/rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.83"
2+
channel = "1.85"
33
profile = "default"

rust/signed_doc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "catalyst-signed-doc"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition.workspace = true
55
authors.workspace = true
66
homepage.workspace = true

rust/signed_doc/src/lib.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,22 @@ impl Encode<()> for CatalystSignedDocument {
258258
}
259259
}
260260

261+
impl TryFrom<&[u8]> for CatalystSignedDocument {
262+
type Error = anyhow::Error;
263+
264+
fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
265+
Ok(minicbor::decode(value)?)
266+
}
267+
}
268+
269+
impl TryFrom<CatalystSignedDocument> for Vec<u8> {
270+
type Error = anyhow::Error;
271+
272+
fn try_from(value: CatalystSignedDocument) -> Result<Self, Self::Error> {
273+
Ok(minicbor::to_vec(value)?)
274+
}
275+
}
276+
261277
#[cfg(test)]
262278
mod tests {
263279
use std::str::FromStr;
@@ -311,8 +327,8 @@ mod tests {
311327

312328
assert!(!doc.problem_report().is_problematic());
313329

314-
let bytes = minicbor::to_vec(doc).unwrap();
315-
let decoded: CatalystSignedDocument = minicbor::decode(bytes.as_slice()).unwrap();
330+
let bytes: Vec<u8> = doc.try_into().unwrap();
331+
let decoded: CatalystSignedDocument = bytes.as_slice().try_into().unwrap();
316332

317333
assert_eq!(decoded.doc_type().unwrap(), uuid_v4);
318334
assert_eq!(decoded.doc_id().unwrap(), uuid_v7);

0 commit comments

Comments
 (0)