feeless 0.1.11

A Nano (cryptocurrency) node and utilities such as nano addresses, hashing blocks, signing, etc.
Documentation
use crate::blocks::BlockHash;
use crate::keys::public::{from_address, to_address};
use crate::{Public, Signature, Work};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct OpenBlock {
    /// BlockHash of the Open block sending the funds to this account.
    pub source: BlockHash,

    #[serde(serialize_with = "to_address", deserialize_with = "from_address")]
    pub representative: Public,

    #[serde(serialize_with = "to_address", deserialize_with = "from_address")]
    pub account: Public,

    pub work: Option<Work>,
    pub signature: Option<Signature>,
}

impl OpenBlock {
    pub fn new(source: BlockHash, representative: Public, account: Public) -> Self {
        Self {
            source,
            representative,
            account,
            work: None,
            signature: None,
        }
    }
}