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

@@ -1,12 +1,10 @@
use scale::Encode;
use sp_core::Pair;
use serai_client::{
primitives::insecure_pair_from_name,
validator_sets::primitives::{Session, ValidatorSet},
in_instructions::{
primitives::{Batch, SignedBatch},
primitives::{Batch, SignedBatch, batch_message},
InInstructionsEvent,
},
Serai,
@@ -32,7 +30,7 @@ pub async fn provide_batch(batch: Batch) -> [u8; 32] {
let block = publish_tx(&Serai::execute_batch(SignedBatch {
batch: batch.clone(),
signature: pair.sign(&batch.encode()),
signature: pair.sign(&batch_message(&batch)),
}))
.await;