use crate::ids;

/// ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/message#InternalMsgBuilder
/// ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/message#ResponseToFailedOps
/// ref. "InternalFailedRequest(message.GetAncestorsFailed)"
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub struct Message {
    pub chain_id: ids::Id,
    pub request_id: u32,

    pub sent_to: ids::node::Id,
}

/// ref. https://doc.rust-lang.org/std/string/trait.ToString.html
/// ref. https://doc.rust-lang.org/std/fmt/trait.Display.html
/// Use "Self.to_string()" to directly invoke this
impl std::fmt::Display for Message {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "msg get_ancestors_failed")
    }
}
