Tidy up mini protocols
This commit is contained in:
parent
cb2f243fa6
commit
ce0061eb52
9 changed files with 115 additions and 59 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use itertools::Itertools;
|
||||
use pallas_machines::{DecodePayload, EncodePayload, MachineError, PayloadEncoder};
|
||||
use pallas_machines::{CodecError, DecodePayload, EncodePayload, PayloadEncoder};
|
||||
use std::{collections::HashMap, fmt::Debug};
|
||||
|
||||
pub const TESTNET_MAGIC: u64 = 1097911063;
|
||||
|
|
@ -97,7 +97,7 @@ impl DecodePayload for RefuseReason {
|
|||
|
||||
Ok(RefuseReason::Refused(version, msg.to_string()))
|
||||
}
|
||||
x => Err(Box::new(MachineError::BadLabel(x))),
|
||||
x => Err(Box::new(CodecError::BadLabel(x))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
use core::panic;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use pallas_machines::{
|
||||
Agent, DecodePayload, EncodePayload, MachineError, MachineOutput, PayloadDecoder,
|
||||
PayloadEncoder,
|
||||
};
|
||||
use pallas_machines::{Agent, CodecError, DecodePayload, EncodePayload, MachineOutput, PayloadDecoder, PayloadEncoder};
|
||||
|
||||
use crate::common::{NetworkMagic, RefuseReason, VersionNumber};
|
||||
|
||||
|
|
@ -104,7 +101,7 @@ impl DecodePayload for Message {
|
|||
let reason = RefuseReason::decode_payload(d)?;
|
||||
Ok(Message::Refuse(reason))
|
||||
}
|
||||
x => Err(Box::new(MachineError::BadLabel(x))),
|
||||
x => Err(Box::new(CodecError::BadLabel(x))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
use core::panic;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use pallas_machines::{
|
||||
Agent, DecodePayload, EncodePayload, MachineError, MachineOutput, PayloadDecoder,
|
||||
PayloadEncoder,
|
||||
};
|
||||
use pallas_machines::{Agent, CodecError, DecodePayload, EncodePayload, MachineOutput, PayloadDecoder, PayloadEncoder};
|
||||
|
||||
use crate::common::{RefuseReason, VersionNumber};
|
||||
|
||||
|
|
@ -123,7 +120,7 @@ impl DecodePayload for Message {
|
|||
let reason = RefuseReason::decode_payload(d)?;
|
||||
Ok(Message::Refuse(reason))
|
||||
}
|
||||
x => Err(Box::new(MachineError::BadLabel(x))),
|
||||
x => Err(Box::new(CodecError::BadLabel(x))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue