mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-10 21:04:40 +00:00
Don't let the Serai set publish batches
This commit is contained in:
parent
55fe27f41a
commit
e7e30150f0
1 changed files with 7 additions and 2 deletions
|
@ -152,8 +152,13 @@ pub mod pallet {
|
||||||
Err(InvalidTransaction::ExhaustsResources)?;
|
Err(InvalidTransaction::ExhaustsResources)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify the signature
|
|
||||||
let network = batch.batch.network;
|
let network = batch.batch.network;
|
||||||
|
// Don't allow the Serai set to publish `Batch`s as-if Serai itself was an external network
|
||||||
|
if network == NetworkId::Serai {
|
||||||
|
Err(InvalidTransaction::Custom(0))?;
|
||||||
|
}
|
||||||
|
|
||||||
|
// verify the signature
|
||||||
let (current_session, prior, current) = keys_for_network::<T>(network)?;
|
let (current_session, prior, current) = keys_for_network::<T>(network)?;
|
||||||
let batch_message = batch_message(&batch.batch);
|
let batch_message = batch_message(&batch.batch);
|
||||||
// Check the prior key first since only a single `Batch` (the last one) will be when prior is
|
// Check the prior key first since only a single `Batch` (the last one) will be when prior is
|
||||||
|
@ -208,7 +213,7 @@ pub mod pallet {
|
||||||
// Accordingly, there's no value in writing code to fully slash the network, when such an
|
// Accordingly, there's no value in writing code to fully slash the network, when such an
|
||||||
// even would require a runtime upgrade to fully resolve anyways
|
// even would require a runtime upgrade to fully resolve anyways
|
||||||
if instruction.balance.coin.network() != batch.batch.network {
|
if instruction.balance.coin.network() != batch.batch.network {
|
||||||
Err(InvalidTransaction::Custom(0))?;
|
Err(InvalidTransaction::Custom(1))?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue