-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(db): index on `message.id` * Don't use `.sparse()` * Pull out `MessageId` * Move `SyncData` to `responses` * Reuse `_id` for `MessageId` * Create basic integration test * Add option to clear db * Change milestone `milestone_id` to `_id` * Fmt * Remove services from CI
- Loading branch information
Showing
14 changed files
with
166 additions
and
90 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
// Copyright 2022 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
/// Module containing information about the network and state of the node. | ||
pub mod status; | ||
|
||
/// Module containing Stardust data models. | ||
#[cfg(feature = "stardust")] | ||
pub mod stardust; | ||
|
||
/// Module containing information about the network and state of the node. | ||
pub mod status; | ||
/// Module containing sync models. | ||
pub mod sync; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2022 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use std::str::FromStr; | ||
|
||
use bee_message_stardust as bee; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Hash, Ord, PartialOrd, Eq)] | ||
#[serde(transparent)] | ||
pub struct MessageId(#[serde(with = "serde_bytes")] pub Box<[u8]>); | ||
|
||
impl MessageId { | ||
pub fn to_hex(&self) -> String { | ||
prefix_hex::encode(self.0.as_ref()) | ||
} | ||
} | ||
|
||
impl From<bee::MessageId> for MessageId { | ||
fn from(value: bee::MessageId) -> Self { | ||
Self(value.to_vec().into_boxed_slice()) | ||
} | ||
} | ||
|
||
impl TryFrom<MessageId> for bee::MessageId { | ||
type Error = crate::types::error::Error; | ||
|
||
fn try_from(value: MessageId) -> Result<Self, Self::Error> { | ||
Ok(bee::MessageId::new(value.0.as_ref().try_into()?)) | ||
} | ||
} | ||
|
||
impl FromStr for MessageId { | ||
type Err = crate::types::error::ParseError; | ||
|
||
fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
Ok(bee::MessageId::from_str(s)?.into()) | ||
} | ||
} |
Oops, something went wrong.