Skip to content

Commit a7ed16e

Browse files
committed
test_full_publisher_set.rs: Rewrite comment, rename test
1 parent 533ee45 commit a7ed16e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

program/rust/src/tests/test_full_publisher_set.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ use {
2121
// publisher slots on Pythnet are working. Here's how this works:
2222
//
2323
// * Fill all publisher slots on a price
24-
// * Divide the price component array into three parts roughly the
25-
// same size: first_third, middle_third and last_third
26-
// * Publish two distinct price values to first/mid third
24+
// * Divide the price component array into two even halves: first_half, second_half
25+
// * Publish two distinct price values to either half
2726
// * Verify that the aggregate averages out to an expected value in the middle
28-
// * Publish PC_STATUS_UNKNOWN prices to first_third to make sure it does not affect later aggregates
29-
// * Repeat the two-price-value publishing step, using completely
30-
// different values, this time using mid_third and last_third without first_third
31-
// * Verify again for the new values meeting in the middle as aggregate.
3227
#[tokio::test]
33-
async fn test_full_publisher_set_two_thirds() -> Result<(), Box<dyn std::error::Error>> {
28+
async fn test_full_publisher_set() -> Result<(), Box<dyn std::error::Error>> {
3429
let mut sim = PythSimulator::new().await;
3530
let pub_keypairs: Vec<_> = (0..PC_NUM_COMP).map(|_idx| Keypair::new()).collect();
3631
let pub_pubkeys: Vec<_> = pub_keypairs.iter().map(|kp| kp.pubkey()).collect();
@@ -44,7 +39,7 @@ async fn test_full_publisher_set_two_thirds() -> Result<(), Box<dyn std::error::
4439

4540
let n_pubs = pub_keypairs.len();
4641

47-
// Divide publishers into two even parts
42+
// Divide publishers into two even parts (assuming the max PC_NUM_COMP size is even)
4843
let (first_half, second_half) = pub_keypairs.split_at(n_pubs / 2);
4944

5045
// Starting with the first publisher in each half, publish an update

0 commit comments

Comments
 (0)