mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Replace "coin" with "network"
The Processor's coins folder referred to the networks it could process, as did its Coin trait. This, and other similar cases throughout the codebase, have now been corrected. Also corrects dated documentation for a key pair is confirmed under the validator-sets pallet.
This commit is contained in:
@@ -398,7 +398,7 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(
|
||||
key_gen::ProcessorMessage::Shares { id, shares } => {
|
||||
Some(Transaction::DkgShares(id.attempt, shares, Transaction::empty_signed()))
|
||||
}
|
||||
key_gen::ProcessorMessage::GeneratedKeyPair { id, substrate_key, coin_key } => {
|
||||
key_gen::ProcessorMessage::GeneratedKeyPair { id, substrate_key, network_key } => {
|
||||
assert_eq!(
|
||||
id.set.network, msg.network,
|
||||
"processor claimed to be a different network than it was for GeneratedKeyPair",
|
||||
@@ -411,7 +411,7 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(
|
||||
id.set.network,
|
||||
(
|
||||
Public(substrate_key),
|
||||
coin_key
|
||||
network_key
|
||||
.try_into()
|
||||
.expect("external key from processor exceeded max external key length"),
|
||||
),
|
||||
|
||||
@@ -102,7 +102,7 @@ async fn handle_key_gen<D: Db, Pro: Processors>(
|
||||
processor_messages::substrate::CoordinatorMessage::ConfirmKeyPair {
|
||||
context: SubstrateContext {
|
||||
serai_time: block.time().unwrap(),
|
||||
coin_latest_finalized_block: serai
|
||||
network_latest_finalized_block: serai
|
||||
.get_latest_block_for_network(block.hash(), set.network)
|
||||
.await?
|
||||
// The processor treats this as a magic value which will cause it to find a network
|
||||
@@ -176,7 +176,7 @@ async fn handle_batch_and_burns<Pro: Processors>(
|
||||
assert_eq!(HashSet::<&_>::from_iter(networks_with_event.iter()).len(), networks_with_event.len());
|
||||
|
||||
for network in networks_with_event {
|
||||
let coin_latest_finalized_block = if let Some(block) = batch_block.remove(&network) {
|
||||
let network_latest_finalized_block = if let Some(block) = batch_block.remove(&network) {
|
||||
block
|
||||
} else {
|
||||
// If it's had a batch or a burn, it must have had a block acknowledged
|
||||
@@ -194,7 +194,7 @@ async fn handle_batch_and_burns<Pro: Processors>(
|
||||
processor_messages::substrate::CoordinatorMessage::SubstrateBlock {
|
||||
context: SubstrateContext {
|
||||
serai_time: block.time().unwrap(),
|
||||
coin_latest_finalized_block,
|
||||
network_latest_finalized_block,
|
||||
},
|
||||
network,
|
||||
block: block.number(),
|
||||
|
||||
Reference in New Issue
Block a user