Move point struct to shared primitives
This commit is contained in:
parent
dfe8693fbf
commit
ff8743023b
14 changed files with 53 additions and 104 deletions
|
|
@ -1,23 +1,6 @@
|
|||
use super::*;
|
||||
use pallas_machines::*;
|
||||
|
||||
impl EncodePayload for Point {
|
||||
fn encode_payload(&self, e: &mut PayloadEncoder) -> Result<(), Box<dyn std::error::Error>> {
|
||||
e.array(2)?.u64(self.0)?.bytes(&self.1)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl DecodePayload for Point {
|
||||
fn decode_payload(d: &mut PayloadDecoder) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
d.array()?;
|
||||
let slot = d.u64()?;
|
||||
let hash = d.bytes()?;
|
||||
|
||||
Ok(Point(slot, Vec::from(hash)))
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodePayload for AcquireFailure {
|
||||
fn encode_payload(&self, e: &mut PayloadEncoder) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let code = match self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue