Skip to content

Commit d1181dd

Browse files
committed
Merge branch 'main' into feat/rbac-registration
2 parents 89f627a + d4dc27a commit d1181dd

File tree

28 files changed

+1657
-98
lines changed

28 files changed

+1657
-98
lines changed

.github/workflows/semantic_pull_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
rust/c509-certificate
2020
rust/cardano-chain-follower
2121
rust/catalyst-voting
22+
rust/immutable-ledger
23+
rust/vote-tx-v1
24+
rust/vote-tx-v2
2225
rust/cbork
2326
rust/hermes-ipfs
2427
dart

Earthfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ VERSION 0.8
33
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.23 AS mdlint-ci
44
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.23 AS cspell-ci
55

6+
67
FROM debian:stable-slim
78

89
# check-markdown : markdown check using catalyst-ci.

docs/Earthfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ VERSION 0.8
22

33
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.23 AS docs-ci
44

5+
56
IMPORT .. AS repo
67

78
# Copy all the source we need to build the docs

docs/src/architecture/08_concepts/catalyst_voting/cddl/gen_vote_tx.cddl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tx-body<choice-t, proof-t, prop-id-t> = [
77
vote-type
88
event,
99
votes<choice-t, proof-t, prop-id-t>,
10-
voters-data,
10+
voter-data,
1111
]
1212

1313
vote-type = UUID ; e.g. Public or Private vote
@@ -25,7 +25,7 @@ choice<choice-t> = #6.24(bytes .cbor choice-t) ; encoded-cbor
2525
proof<proof-t> = #6.24(bytes .cbor proof-t) ; encoded-cbor
2626
prop-id<prop-id-t> = #6.24(bytes .cbor prop-id-t) ; encoded-cbor
2727

28-
voters-data = encoded-cbor
28+
voter-data = encoded-cbor
2929

3030
UUID = #6.37(bytes) ; UUID type
3131
signature = #6.98(cose.COSE_Sign) ; COSE signature

docs/src/architecture/08_concepts/catalyst_voting/gen_vote_tx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Vote:
4242
so it's redundant to provide an additional identifier for the proposal,
4343
so it could be placed `null`.
4444

45-
`voters-data` - an any additional voter's specific data.
45+
`voter-data` - an any additional voter's specific data.
4646

4747
### Transaction signing
4848

rust/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ members = [
77
"cbork",
88
"cbork-abnf-parser",
99
"cbork-cddl-parser",
10+
"catalyst-voting",
1011
"catalyst-voting",
11-
"jormungandr-vote-tx",
12+
"immutable-ledger",
13+
"vote-tx-v1",
14+
"vote-tx-v2",
1215
"rbac-registration",
1316
]
1417

rust/Earthfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ COPY_SRC:
1010
.cargo .config \
1111
c509-certificate \
1212
cardano-chain-follower \
13-
catalyst-voting jormungandr-vote-tx \
13+
catalyst-voting vote-tx-v1 vote-tx-v2 \
1414
cbork cbork-abnf-parser cbork-cddl-parser \
1515
hermes-ipfs \
16-
.
16+
immutable-ledger .
1717

1818
# builder : Set up our target toolchains, and copy our files.
1919
builder:
@@ -53,7 +53,7 @@ build:
5353
--cmd="/scripts/std_build.py" \
5454
--args1="--libs=c509-certificate --libs=cardano-chain-follower --libs=hermes-ipfs" \
5555
--args2="--libs=cbork-cddl-parser --libs=cbork-abnf-parser" \
56-
--args3="--libs=catalyst-voting --libs=jormungandr-vote-tx" \
56+
--args3="--libs=catalyst-voting --libs=vote-tx-v1 --libs=vote-tx-v2" \
5757
--args4="--bins=cbork/cbork" \
5858
--args5="--cov_report=$HOME/build/coverage-report.info" \
5959
--output="release/[^\./]+" \
@@ -90,4 +90,4 @@ check-builder-src-cache:
9090
# local-ci-run: This step simulates the full CI run for local purposes only.
9191
local-ci-run:
9292
BUILD +check
93-
BUILD +build
93+
BUILD +build

rust/c509-certificate/Earthfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ VERSION 0.8
22

33
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust::v3.2.23 AS rust-ci
44

5+
56
IMPORT .. AS rust-local
67
IMPORT ../.. AS repo
78

rust/catalyst-voting/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ curve25519-dalek = { version = "4.1.3", features = ["digest", "rand_core"] }
2424
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
2525
blake2b_simd = "1.0.2"
2626
rayon = "1.10.0"
27-
proptest = { version = "1.5.0" }
2827

2928
[dev-dependencies]
3029
criterion = "0.5.1"
30+
proptest = { version = "1.5.0" }
3131
# Potentially it could be replaced with using `proptest::property_test` attribute macro,
3232
# after this PR will be merged https://github.com/proptest-rs/proptest/pull/523
3333
test-strategy = "0.4.0"

rust/catalyst-voting/src/crypto/ed25519/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use ed25519_dalek::{
66
ed25519::signature::Signer, Signature as Ed25519Signature, SigningKey, VerifyingKey,
77
};
88

9+
use super::rng::default_rng;
910
use crate::crypto::rng::rand_core::CryptoRngCore;
1011

1112
/// `Ed25519` private key struct.
@@ -19,6 +20,11 @@ impl PrivateKey {
1920
Self(SigningKey::generate(rng))
2021
}
2122

23+
/// Randomly generate the `ElectionSecretKey` with the `crypto::default_rng`.
24+
pub fn random_with_default_rng() -> Self {
25+
Self::random(&mut default_rng())
26+
}
27+
2228
/// Get associated `Ed25519` public key.
2329
pub fn public_key(&self) -> PublicKey {
2430
PublicKey(self.0.verifying_key())
@@ -46,7 +52,7 @@ pub fn verify_signature(pk: &PublicKey, msg: &[u8], sig: &Signature) -> bool {
4652
pk.0.verify_strict(msg, &sig.0).is_ok()
4753
}
4854

49-
#[allow(missing_docs, clippy::missing_docs_in_private_items)]
55+
#[cfg(test)]
5056
mod arbitrary_impl {
5157
use proptest::prelude::{any, Arbitrary, BoxedStrategy, Strategy};
5258

0 commit comments

Comments
 (0)