Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*): Update external rust SDK types #5195

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
48 changes: 24 additions & 24 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ indexmap = { version = "2.1.0", features = ["serde"] }
indicatif = "0.17.2"
insta = { version = "1.21.1", features = ["redactions", "yaml", "json"] }
integer-encoding = "3.0.1"
# core-types with json format for REST API
iota-sdk2 = { package = "iota-sdk-types", git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "b3b33187aaad4d5b70f511627832c2efd525ced7", features = ["hash", "serde", "schemars"] }
itertools = "0.13.0"
json_to_table = { git = "https://github.com/zhiburt/tabled/", rev = "e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" }
jsonrpsee = { version = "0.24", features = ["server", "macros", "client", "ws-client", "http-client"] }
Expand Down Expand Up @@ -304,7 +306,7 @@ rand = "0.8.5"
rayon = "1.5.3"
regex = "1.7.1"
reqwest = { version = "0.12", default-features = false, features = ["http2", "json", "rustls-tls"] }
roaring = "0.10.6"
roaring = "0.10.10"
rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "multi-threaded-cf"] }
rstest = "0.16.0"
rustls = { version = "0.23.18", default-features = false, features = ["std", "tls12", "ring"] }
Expand Down Expand Up @@ -413,8 +415,6 @@ iota-rest-api = { path = "crates/iota-rest-api" }
iota-rosetta = { path = "crates/iota-rosetta" }
iota-rpc-loadgen = { path = "crates/iota-rpc-loadgen" }
iota-sdk = { path = "crates/iota-sdk" }
# core-types with json format for REST API
iota-sdk2 = { package = "iota-rust-sdk", git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "2ba6b293bdede769a1d9b4d1aecaede2ff7682dd", features = ["hash", "serde", "schemars"] }
iota-simulator = { path = "crates/iota-simulator" }
iota-snapshot = { path = "crates/iota-snapshot" }
iota-source-validation = { path = "crates/iota-source-validation" }
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-core/src/checkpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ impl CheckpointBuilder {
TransactionKind::ConsensusCommitPrologueV1(_)
| TransactionKind::AuthenticatorStateUpdateV1(_) => {
// ConsensusCommitPrologue and
// AuthenticatorStateUpdateV1
// AuthenticatorStateUpdate
// are guaranteed to be
// processed before we reach here.
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-rpc/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ type AuthenticatorStateExpireTransaction {
"""
minEpoch: Epoch
"""
The initial version that the AuthenticatorStateUpdateV1 was shared at.
The initial version that the AuthenticatorStateUpdate was shared at.
"""
authenticatorObjInitialSharedVersion: UInt53!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl AuthenticatorStateExpireTransaction {
.extend()
}

/// The initial version that the AuthenticatorStateUpdateV1 was shared at.
/// The initial version that the AuthenticatorStateUpdate was shared at.
async fn authenticator_obj_initial_shared_version(&self) -> UInt53 {
self.native
.authenticator_obj_initial_shared_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type AuthenticatorStateExpireTransaction {
"""
minEpoch: Epoch
"""
The initial version that the AuthenticatorStateUpdateV1 was shared at.
The initial version that the AuthenticatorStateUpdate was shared at.
"""
authenticatorObjInitialSharedVersion: UInt53!
}
Expand Down
6 changes: 3 additions & 3 deletions crates/iota-rest-api/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,7 @@
"type": "string",
"pattern": "(?:[a-zA-Z][a-zA-Z0-9_]{0,127})|(?:_[a-zA-Z0-9_]{0,127})"
},
"InputArgument": {
"Input": {
"oneOf": [
{
"type": "object",
Expand Down Expand Up @@ -4382,7 +4382,7 @@
"description": "Input objects or primitive values",
"type": "array",
"items": {
"$ref": "#/components/schemas/InputArgument"
"$ref": "#/components/schemas/Input"
}
},
"kind": {
Expand Down Expand Up @@ -4908,7 +4908,7 @@
]
},
"signatures": {
"description": "The plain signature encoded with signature scheme.",
"description": "The plain signature encoded with signature scheme.\n\nThe signatures must be in the same order as they are listed in the committee.",
"type": "array",
"items": {
"$ref": "#/components/schemas/MultisigMemberSignature"
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use axum::extract::{Path, Query, State};
use iota_sdk2::types::{Address, ObjectId, StructTag, Version};
use iota_sdk2::{Address, ObjectId, StructTag, Version};
use iota_types::iota_sdk2_conversions::struct_tag_core_to_sdk;
use openapiv3::v3_1::Operation;
use tap::Pipe;
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/checkpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use axum::extract::{Path, Query, State};
use iota_sdk2::types::{
use iota_sdk2::{
CheckpointData, CheckpointDigest, CheckpointSequenceNumber, SignedCheckpointSummary,
};
use iota_types::storage::ReadStore;
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/client/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_sdk2::types::{
use iota_sdk2::{
Address, CheckpointData, CheckpointDigest, CheckpointSequenceNumber, EpochId, Object, ObjectId,
SignedCheckpointSummary, SignedTransaction, StructTag, TransactionDigest, ValidatorCommittee,
Version,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use axum::{
Json,
extract::{Path, State},
};
use iota_sdk2::types::{ObjectId, StructTag};
use iota_sdk2::{ObjectId, StructTag};
use iota_types::iota_sdk2_conversions::struct_tag_sdk_to_core;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/committee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use axum::extract::{Path, State};
use iota_sdk2::types::{EpochId, ValidatorCommittee};
use iota_sdk2::{EpochId, ValidatorCommittee};
use iota_types::storage::ReadStore;
use tap::Pipe;

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::borrow::Cow;

use axum::{Json, extract::State};
use iota_sdk2::types::CheckpointDigest;
use iota_sdk2::CheckpointDigest;
use tap::Pipe;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use axum::extract::{Path, Query, State};
use iota_sdk2::types::{Object, ObjectId, TypeTag, Version};
use iota_sdk2::{Object, ObjectId, TypeTag, Version};
use iota_types::{
iota_sdk2_conversions::type_tag_core_to_sdk,
storage::{DynamicFieldIndexInfo, DynamicFieldKey},
Expand Down
12 changes: 6 additions & 6 deletions crates/iota-rest-api/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use std::sync::Arc;

use iota_sdk2::types::{
use iota_sdk2::{
CheckpointSequenceNumber, EpochId, Object, ObjectId, SignedTransaction, ValidatorCommittee,
Version,
};
Expand Down Expand Up @@ -64,11 +64,11 @@ impl StateReader {

pub fn get_transaction(
&self,
digest: iota_sdk2::types::TransactionDigest,
digest: iota_sdk2::TransactionDigest,
) -> crate::Result<(
iota_sdk2::types::SignedTransaction,
iota_sdk2::types::TransactionEffects,
Option<iota_sdk2::types::TransactionEvents>,
iota_sdk2::SignedTransaction,
iota_sdk2::TransactionEffects,
Option<iota_sdk2::TransactionEvents>,
)> {
use iota_types::effects::TransactionEffectsAPI;

Expand Down Expand Up @@ -100,7 +100,7 @@ impl StateReader {

pub fn get_transaction_response(
&self,
digest: iota_sdk2::types::TransactionDigest,
digest: iota_sdk2::TransactionDigest,
) -> crate::Result<super::transactions::TransactionResponse> {
let (
SignedTransaction {
Expand Down
38 changes: 16 additions & 22 deletions crates/iota-rest-api/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use axum::{
extract::{Path, State},
};
use iota_protocol_config::{ProtocolConfig, ProtocolConfigValue, ProtocolVersion};
use iota_sdk2::types::{Address, ObjectId};
use iota_sdk2::{Address, ObjectId};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -237,9 +237,9 @@ pub struct SystemStateSummary {
pub struct ValidatorSummary {
// Metadata
pub address: Address,
pub authority_public_key: iota_sdk2::types::Bls12381PublicKey,
pub network_public_key: iota_sdk2::types::Ed25519PublicKey,
pub protocol_public_key: iota_sdk2::types::Ed25519PublicKey,
pub authority_public_key: iota_sdk2::Bls12381PublicKey,
pub network_public_key: iota_sdk2::Ed25519PublicKey,
pub protocol_public_key: iota_sdk2::Ed25519PublicKey,
#[serde_as(as = "fastcrypto::encoding::Base64")]
#[schemars(with = "String")]
pub proof_of_possession_bytes: Vec<u8>,
Expand All @@ -250,9 +250,9 @@ pub struct ValidatorSummary {
pub net_address: String,
pub p2p_address: String,
pub primary_address: String,
pub next_epoch_authority_public_key: Option<iota_sdk2::types::Bls12381PublicKey>,
pub next_epoch_network_public_key: Option<iota_sdk2::types::Ed25519PublicKey>,
pub next_epoch_protocol_public_key: Option<iota_sdk2::types::Ed25519PublicKey>,
pub next_epoch_authority_public_key: Option<iota_sdk2::Bls12381PublicKey>,
pub next_epoch_network_public_key: Option<iota_sdk2::Ed25519PublicKey>,
pub next_epoch_protocol_public_key: Option<iota_sdk2::Ed25519PublicKey>,
#[serde_as(as = "Option<fastcrypto::encoding::Base64>")]
#[schemars(with = "Option<String>")]
pub next_epoch_proof_of_possession: Option<Vec<u8>>,
Expand Down Expand Up @@ -374,18 +374,12 @@ impl From<iota_types::iota_system_state::iota_system_state_summary::IotaValidato

Self {
address: iota_address.into(),
authority_public_key: iota_sdk2::types::Bls12381PublicKey::from_bytes(
authority_pubkey_bytes,
)
.unwrap(),
network_public_key: iota_sdk2::types::Ed25519PublicKey::from_bytes(
network_pubkey_bytes,
)
.unwrap(),
protocol_public_key: iota_sdk2::types::Ed25519PublicKey::from_bytes(
protocol_pubkey_bytes,
)
.unwrap(),
authority_public_key: iota_sdk2::Bls12381PublicKey::from_bytes(authority_pubkey_bytes)
.unwrap(),
network_public_key: iota_sdk2::Ed25519PublicKey::from_bytes(network_pubkey_bytes)
.unwrap(),
protocol_public_key: iota_sdk2::Ed25519PublicKey::from_bytes(protocol_pubkey_bytes)
.unwrap(),
proof_of_possession_bytes,
name,
description,
Expand All @@ -395,11 +389,11 @@ impl From<iota_types::iota_system_state::iota_system_state_summary::IotaValidato
p2p_address,
primary_address,
next_epoch_authority_public_key: next_epoch_authority_pubkey_bytes
.map(|bytes| iota_sdk2::types::Bls12381PublicKey::from_bytes(bytes).unwrap()),
.map(|bytes| iota_sdk2::Bls12381PublicKey::from_bytes(bytes).unwrap()),
next_epoch_network_public_key: next_epoch_network_pubkey_bytes
.map(|bytes| iota_sdk2::types::Ed25519PublicKey::from_bytes(bytes).unwrap()),
.map(|bytes| iota_sdk2::Ed25519PublicKey::from_bytes(bytes).unwrap()),
next_epoch_protocol_public_key: next_epoch_protocol_pubkey_bytes
.map(|bytes| iota_sdk2::types::Ed25519PublicKey::from_bytes(bytes).unwrap()),
.map(|bytes| iota_sdk2::Ed25519PublicKey::from_bytes(bytes).unwrap()),
next_epoch_proof_of_possession,
next_epoch_net_address,
next_epoch_p2p_address,
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-rest-api/src/transactions/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::{net::SocketAddr, sync::Arc};

use axum::extract::{Query, State};
use iota_sdk2::types::{
use iota_sdk2::{
Address, BalanceChange, CheckpointSequenceNumber, Object, Owner, SignedTransaction,
TransactionEffects, TransactionEvents, ValidatorAggregatedSignature, framework::Coin,
};
Expand Down Expand Up @@ -318,14 +318,14 @@ fn derive_balance_changes(
let balances = coins(input_objects).fold(
std::collections::BTreeMap::<_, i128>::new(),
|mut acc, (address, coin)| {
*acc.entry((address, coin.coin_type())).or_default() -= coin.balance() as i128;
*acc.entry((address, coin.coin_type().clone())).or_default() -= coin.balance() as i128;
acc
},
);

// 2. add all mutated coins
let balances = coins(output_objects).fold(balances, |mut acc, (address, coin)| {
*acc.entry((address, coin.coin_type())).or_default() += coin.balance() as i128;
*acc.entry((address, coin.coin_type().clone())).or_default() += coin.balance() as i128;
acc
});

Expand All @@ -338,7 +338,7 @@ fn derive_balance_changes(

Some(BalanceChange {
address: *address,
coin_type: coin_type.to_owned(),
coin_type,
amount,
})
})
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rest-api/src/transactions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use execution::{
EffectsFinality, ExecuteTransaction, ExecuteTransactionQueryParameters,
TransactionExecutionResponse,
};
use iota_sdk2::types::{
use iota_sdk2::{
CheckpointSequenceNumber, Transaction, TransactionDigest, TransactionEffects,
TransactionEvents, UserSignature,
};
Expand Down
Loading
Loading