File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
rust/jormungandr-vote-tx/src Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22//!
33//! ```rust
44//! use catalyst_voting::{
5- //! crypto::{default_rng, ed25519::PrivateKey},
6- //! txs::v1::Tx,
5+ //! crypto::{ed25519::PrivateKey, rng::default_rng},
76//! vote_protocol::committee::ElectionSecretKey,
87//! };
8+ //! use jormungandr_vote_tx::Tx;
99//!
1010//! let vote_plan_id = [0u8; 32];
1111//! let proposal_index = 0u8;
1414//! let choice = 1;
1515//!
1616//! let users_private_key = PrivateKey::random(&mut default_rng());
17- //! let election_public_key = ElectionSecretKey::random_with_default_rng().public_key();
17+ //! let election_secret_key = ElectionSecretKey::random_with_default_rng();
18+ //! let election_public_key = election_secret_key.public_key();
1819//!
1920//! let public_tx = Tx::new_public(
2021//! vote_plan_id,
2526//! )
2627//! .unwrap();
2728//! public_tx.verify_signature().unwrap();
29+ //! let tx_choice = public_tx.public_choice().unwrap();
30+ //! assert_eq!(tx_choice, choice);
2831//!
2932//! let private_tx = Tx::new_private_with_default_rng(
3033//! vote_plan_id,
3740//! .unwrap();
3841//! private_tx.verify_signature().unwrap();
3942//! private_tx.verify_proof(&election_public_key).unwrap();
43+ //! let tx_choice = private_tx.private_choice(&election_secret_key).unwrap();
44+ //! assert_eq!(tx_choice, choice);
4045//! ```
4146
4247mod decoding;
You can’t perform that action at this time.
0 commit comments