Use proper messages for ValidatorSets/InInstructions pallet

Provides a DST, and associated metadata as beneficial.

Also utilizes MuSig's context to session-bind. Since set_keys_messages also
binds to set, this is semi-redundant, yet that's appreciated.
This commit is contained in:
Luke Parker
2023-05-13 04:20:13 -04:00
parent 663b5f4b50
commit 47f8766da6
17 changed files with 102 additions and 70 deletions

View File

@@ -9,7 +9,7 @@ use sp_runtime::RuntimeDebug;
use serai_primitives::{BlockHash, NetworkId};
pub use in_instructions_primitives as primitives;
use primitives::{InInstruction, InInstructionWithBalance, SignedBatch};
use primitives::*;
#[derive(Clone, Copy, Encode, RuntimeDebug)]
#[cfg_attr(feature = "std", derive(scale::Decode, thiserror::Error))]
@@ -141,7 +141,7 @@ pub mod pallet {
}
};
if !key.verify(&batch.batch.encode(), &batch.signature) {
if !key.verify(&batch_message(&batch.batch), &batch.signature) {
Err(InvalidTransaction::BadProof)?;
}