Merge branch 'develop' into next

This commit is contained in:
Luke Parker
2025-10-05 18:43:53 -04:00
102 changed files with 3016 additions and 4149 deletions

View File

@@ -31,9 +31,9 @@ serde_json = { version = "1", optional = true }
serai-abi = { path = "../abi", version = "0.1" }
multiaddr = { version = "0.18", optional = true }
sp-core = { git = "https://github.com/serai-dex/substrate", optional = true }
sp-runtime = { git = "https://github.com/serai-dex/substrate", optional = true }
frame-system = { git = "https://github.com/serai-dex/substrate", optional = true }
sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "da19e1f8ca7a9e2cbf39fbfa493918eeeb45e10b", optional = true }
sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "da19e1f8ca7a9e2cbf39fbfa493918eeeb45e10b", optional = true }
frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "da19e1f8ca7a9e2cbf39fbfa493918eeeb45e10b", optional = true }
async-lock = "3"

View File

@@ -1,3 +1,5 @@
#![expect(clippy::cast_possible_truncation)]
#[cfg(feature = "networks")]
pub mod networks;

View File

@@ -291,7 +291,7 @@ impl Serai {
self
.0
.rpc()
.system_account_next_index(&sp_core::sr25519::Public(address.0).to_string())
.system_account_next_index(&sp_core::sr25519::Public::from(address.0).to_string())
.await
.map_err(|_| SeraiError::ConnectionError)
}
@@ -316,7 +316,7 @@ impl Serai {
&self,
network: ExternalNetworkId,
) -> Result<Vec<multiaddr::Multiaddr>, SeraiError> {
self.call("p2p_validators", network).await
self.call("p2p_validators", [network]).await
}
// TODO: move this to SeraiValidatorSets?

View File

@@ -8,7 +8,7 @@ use ciphersuite::{WrappedGroup, GroupIo};
use dkg_musig::musig;
use schnorrkel::Schnorrkel;
use sp_core::{sr25519::Signature, Pair as PairTrait};
use sp_core::Pair as PairTrait;
use serai_abi::{
primitives::{
@@ -117,6 +117,6 @@ async fn set_values(serai: &Serai, values: &Values) {
// oraclize values
let _ =
publish_tx(serai, &SeraiGenesisLiquidity::oraclize_values(*values, Signature(sig.to_bytes())))
publish_tx(serai, &SeraiGenesisLiquidity::oraclize_values(*values, sig.to_bytes().into()))
.await;
}

View File

@@ -8,12 +8,7 @@ use ciphersuite::{WrappedGroup, GroupIo};
use dkg_musig::musig;
use schnorrkel::Schnorrkel;
use sp_core::{
ConstU32,
bounded_vec::BoundedVec,
sr25519::{Pair, Signature},
Pair as PairTrait,
};
use sp_core::{ConstU32, bounded_vec::BoundedVec, sr25519::Pair, Pair as PairTrait};
use serai_abi::primitives::NetworkId;
@@ -73,7 +68,7 @@ pub async fn set_keys(
set.network,
key_pair.clone(),
bitvec::bitvec!(u8, bitvec::prelude::Lsb0; 1; musig_keys.len()),
Signature(sig.to_bytes()),
sig.to_bytes().into(),
),
)
.await;

View File

@@ -57,7 +57,7 @@ async fn set_network_keys<C: Ciphersuite>(
let network_priv_key = Zeroizing::new(C::F::random(&mut OsRng));
let network_key = (C::generator() * *network_priv_key).to_bytes().as_ref().to_vec();
let key_pair = KeyPair(Public(ristretto_key), network_key.try_into().unwrap());
let key_pair = KeyPair(Public::from(ristretto_key), network_key.try_into().unwrap());
let _ = set_keys(serai, set, key_pair, pairs).await;
}

View File

@@ -32,7 +32,7 @@ fn get_random_key_pair() -> KeyPair {
OsRng.fill_bytes(&mut ristretto_key);
let mut external_key = vec![0; 33];
OsRng.fill_bytes(&mut external_key);
KeyPair(Public(ristretto_key), external_key.try_into().unwrap())
KeyPair(Public::from(ristretto_key), external_key.try_into().unwrap())
}
async fn get_ordered_keys(serai: &Serai, network: NetworkId, accounts: &[Pair]) -> Vec<Pair> {