Skip to content

Commit

Permalink
chore: rm unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Oct 25, 2024
1 parent fa1cfd0 commit 5b31375
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions bolt-cli/src/common/bolt_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,64 +94,3 @@ sol! {
error ValidatorDoesNotExist();
}
}

#[cfg(test)]
mod tests {
use std::str::FromStr;

use alloy::primitives::U256;

use super::*;

#[tokio::test]
async fn test_get_operators_helder() -> eyre::Result<()> {
let registry = BoltManager::new(
Url::parse("http://remotebeast:4485")?,
Address::from_str("0xdF11D829eeC4C192774F3Ec171D822f6Cb4C14d9")?,
);

let sample_pubkey = B256::from_str("0xsamplepubkeyhash").expect("invalid pubkey");

let registrant = registry.get_proposer_status(sample_pubkey).await;
assert!(matches!(registrant, Ok(None)));

let invalid_pubkey = B256::from_str("0xinvalidsamplepubkeyhash").expect("invalid pubkey");
let registrant = match registry.get_proposer_status(invalid_pubkey).await {
Ok(Some(registrant)) => registrant,
e => panic!("unexpected error reading from registry: {:?}", e),
};

let expected = ProposerStatus {
pubkeyHash: sample_pubkey,
active: true,
operator: Address::from_str("0xad3cd1b81c80f4a495d6552ae6423508492a27f8")?,
operatorRPC: "http://sampleoperatorrpc:8000".to_string(),
collaterals: vec![Address::from_str("0xsamplecollateral1")?],
amounts: vec![U256::from(10000000000000000000u128)],
};

assert_eq!(registrant.pubkeyHash, expected.pubkeyHash);
assert_eq!(registrant.active, expected.active);
assert_eq!(registrant.operator, expected.operator);
assert_eq!(registrant.operatorRPC, expected.operatorRPC);
assert_eq!(registrant.collaterals, expected.collaterals);
assert_eq!(registrant.amounts, expected.amounts);

Ok(())
}

#[tokio::test]
async fn test_check_validator_helder() -> eyre::Result<()> {
let registry = BoltManager::new(
Url::parse("http://remotebeast:48545")?,
Address::from_str("0xdF11D829eeC4C192774F3Ec171D822f6Cb4C14d9")?,
);

let pubkey_hash = B256::from_str("0xsamplepubkeyhash").expect("invalid pubkey");
let registrant = registry.get_sidecar_rpc_url_for_validator(pubkey_hash).await?;
assert!(registrant.is_some());

dbg!(&registrant);
Ok(())
}
}

0 comments on commit 5b31375

Please sign in to comment.