mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Implement a pretty Debug for various objects
This commit is contained in:
@@ -702,6 +702,7 @@ async fn run<C: Coin, D: Db, Co: Coordinator>(mut raw_db: D, coin: C, mut coordi
|
||||
info!("created batch {} ({} instructions)", batch.id, batch.instructions.len());
|
||||
|
||||
// Start signing this batch
|
||||
// TODO: Don't reload both sets of keys in full just to get the Substrate public key
|
||||
tributary_mutable
|
||||
.substrate_signers
|
||||
.get_mut(tributary_mutable.key_gen.keys(&key).0.group_key().to_bytes().as_slice())
|
||||
|
||||
@@ -69,13 +69,24 @@ impl<C: Coin> Payment<C> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Plan<C: Coin> {
|
||||
pub key: <C::Curve as Ciphersuite>::G,
|
||||
pub inputs: Vec<C::Output>,
|
||||
pub payments: Vec<Payment<C>>,
|
||||
pub change: Option<<C::Curve as Ciphersuite>::G>,
|
||||
}
|
||||
impl<C: Coin> core::fmt::Debug for Plan<C> {
|
||||
fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
|
||||
fmt
|
||||
.debug_struct("Plan")
|
||||
.field("key", &hex::encode(self.key.to_bytes()))
|
||||
.field("inputs", &self.inputs)
|
||||
.field("payments", &self.payments)
|
||||
.field("change", &self.change.map(|change| hex::encode(change.to_bytes())))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl<C: Coin> Plan<C> {
|
||||
pub fn transcript(&self) -> RecommendedTranscript {
|
||||
|
||||
Reference in New Issue
Block a user