Skip to content

Commit e8ca39d

Browse files
committed
test: test get_sortition_info rpc endpoint vrf_seed value
1 parent 77f1829 commit e8ca39d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

stackslib/src/net/api/getsortition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub struct SortitionInfo {
114114
/// In Stacks 3.x, this is the first block of the parent tenure.
115115
pub committed_block_hash: Option<BlockHeaderHash>,
116116
#[serde(with = "prefix_opt_hex")]
117-
/// doc
117+
/// This is the VRF seed generated by this sortition
118118
pub vrf_seed: Option<VRFSeed>,
119119
}
120120

stackslib/src/net/api/tests/getsortition.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use std::collections::BTreeMap;
1717
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
1818

19+
use clarity::types::chainstate::VRFSeed;
1920
use stacks_common::types::chainstate::{BurnchainHeaderHash, ConsensusHash};
2021
use stacks_common::types::net::PeerHost;
2122

@@ -159,6 +160,13 @@ fn response() {
159160
let second_entry: SortitionInfo = serde_json::from_value(info_array[1].clone())
160161
.expect("Response array elements should parse to SortitionInfo");
161162
assert!(first_entry.was_sortition);
163+
assert_eq!(
164+
first_entry.vrf_seed,
165+
Some(
166+
VRFSeed::from_hex("48b754acc291a5bfad1354ee19bbc471f14af2b21dc7eccc0f929bd16798defe")
167+
.unwrap()
168+
)
169+
);
162170
assert!(second_entry.was_sortition);
163171
assert_eq!(
164172
first_entry.last_sortition_ch.as_ref().unwrap(),

0 commit comments

Comments
 (0)