Skip to content

Commit

Permalink
chore(deps): bump iota-types (#1089)
Browse files Browse the repository at this point in the history
* chore(deps): bump `iota-types`

* Fmt

* Use `main` branch

* Use released version

* fix `use` statement

* Fix other `use` statements

* fix doc comments
  • Loading branch information
grtlr committed Feb 9, 2023
1 parent 94c881b commit 3cc9163
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
38 changes: 32 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -33,7 +33,7 @@ futures = { version = "0.3", default-features = false }
humantime = { version = "2.1.0", default-features = false }
humantime-serde = { version = "1.1", default-features = false }
iota-crypto = { version = "0.15", default-features = false, features = [ "blake2b" ] }
iota-types = { version = "1.0.0-rc.4", default-features = false, features = [ "api", "block", "std" ] }
iota-types = { version = "1.0.0-rc.5", default-features = false, features = [ "api", "block", "std" ] }
mongodb = { version = "2.3", default-features = false, features = [ "tokio-runtime" ] }
packable = { version = "0.7", default-features = false }
pin-project = { version = "1.0", default-features = false }
Expand Down Expand Up @@ -76,7 +76,7 @@ inx = { version = "1.0.0-beta.8", default-features = false, optional = true }
tonic = { version = "0.8", default-features = false, optional = true }

[dev-dependencies]
iota-types = { version = "1.0.0-rc.4", default-features = false, features = [ "api", "block", "std", "rand" ] }
iota-types = { version = "1.0.0-rc.5", default-features = false, features = [ "api", "block", "std", "rand" ] }
rand = { version = "0.8", default-features = false, features = [ "std" ] }

[features]
Expand Down
6 changes: 3 additions & 3 deletions src/bin/inx-chronicle/api/stardust/core/responses.rs
@@ -1,7 +1,7 @@
// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_types::{api::response as iota, block::protocol::dto::ProtocolParametersDto};
use iota_types::{api::core::response as iota, block::protocol::dto::ProtocolParametersDto};
use serde::{Deserialize, Serialize};

use crate::api::responses::impl_success_response;
Expand All @@ -20,7 +20,7 @@ pub struct InfoResponse {
impl_success_response!(InfoResponse);

/// A wrapper struct that allows us to implement [`IntoResponse`](axum::response::IntoResponse) for the foreign
/// responses from [`iota_types`](iota_types::api::response).
/// responses from [`iota_types`](iota_types::api::core::response).
#[derive(Clone, Debug, Serialize, derive_more::From)]
pub struct IotaResponse<T: Serialize>(T);

Expand All @@ -31,7 +31,7 @@ impl<T: Serialize> axum::response::IntoResponse for IotaResponse<T> {
}

/// A wrapper struct that allows us to implement [`IntoResponse`](axum::response::IntoResponse) for the foreign
/// raw responses from [`iota_types`](iota_types::api::response).
/// raw responses from [`iota_types`](iota_types::api::core::response).
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IotaRawResponse<T: Serialize> {
Expand Down
17 changes: 7 additions & 10 deletions src/bin/inx-chronicle/api/stardust/core/routes.rs
Expand Up @@ -31,16 +31,16 @@ use chronicle::{
};
use futures::TryStreamExt;
use iota_types::{
api::{
api::core::{
dto::ReceiptDto,
response::{
self as iota, BaseTokenResponse, BlockMetadataResponse, ConfirmedMilestoneResponse,
LatestMilestoneResponse, OutputMetadataResponse, OutputWithMetadataResponse, ReceiptsResponse,
StatusResponse, TreasuryResponse, UtxoChangesResponse,
LatestMilestoneResponse, OutputWithMetadataResponse, ReceiptsResponse, StatusResponse, TreasuryResponse,
UtxoChangesResponse,
},
},
block::{
output::dto::RentStructureDto,
output::dto::{OutputMetadataDto, RentStructureDto},
payload::{dto::MilestonePayloadDto, milestone::option::dto::MilestoneOptionDto},
protocol::dto::ProtocolParametersDto,
BlockDto,
Expand Down Expand Up @@ -246,11 +246,8 @@ async fn block_metadata(
Ok(create_block_metadata_response(block_id, metadata).into())
}

fn create_output_metadata_response(
metadata: OutputMetadataResult,
ledger_index: MilestoneIndex,
) -> iota::OutputMetadataResponse {
iota::OutputMetadataResponse {
fn create_output_metadata_response(metadata: OutputMetadataResult, ledger_index: MilestoneIndex) -> OutputMetadataDto {
OutputMetadataDto {
block_id: metadata.block_id.to_hex(),
transaction_id: metadata.output_id.transaction_id.to_hex(),
output_index: metadata.output_id.index,
Expand Down Expand Up @@ -313,7 +310,7 @@ async fn output(
async fn output_metadata(
database: Extension<MongoDb>,
Path(output_id): Path<String>,
) -> ApiResult<IotaResponse<OutputMetadataResponse>> {
) -> ApiResult<IotaResponse<OutputMetadataDto>> {
let ledger_index = database
.collection::<MilestoneCollection>()
.get_ledger_index()
Expand Down
2 changes: 1 addition & 1 deletion src/types/ledger/inclusion_state.rs
@@ -1,7 +1,7 @@
// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_types::api::dto as iota;
use iota_types::api::core::dto as iota;
use mongodb::bson::Bson;
use serde::{Deserialize, Serialize};

Expand Down

0 comments on commit 3cc9163

Please sign in to comment.