Use an enum for Coin/NetworkId

It originally wasn't an enum so software which had yet to update before an
integration wouldn't error (as now enums are strictly typed). The strict typing
is preferable though.
This commit is contained in:
Luke Parker
2023-04-18 02:01:53 -04:00
parent 6f3b5f4535
commit 9da0eb69c7
15 changed files with 97 additions and 70 deletions

View File

@@ -11,7 +11,7 @@ use serai_db::{DbTxn, Db, MemDb};
use sp_application_crypto::sr25519;
use serai_client::{
primitives::{MONERO_NET_ID, BlockHash},
primitives::{BlockHash, NetworkId},
validator_sets::primitives::{Session, ValidatorSet},
};
@@ -22,7 +22,7 @@ use crate::{
};
const ID: KeyGenId =
KeyGenId { set: ValidatorSet { session: Session(1), network: MONERO_NET_ID }, attempt: 3 };
KeyGenId { set: ValidatorSet { session: Session(1), network: NetworkId::Monero }, attempt: 3 };
pub async fn test_key_gen<C: Coin>() {
let mut entropies = HashMap::new();