Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/iota-sdk-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "iota-sdk-crypto"
version = "0.0.1-alpha.1"
authors = ["IOTA Foundation <info@iota.org>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-graphql-client-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "iota-sdk-graphql-client-build"
version = "0.0.1-alpha.1"
authors = ["IOTA Foundation <info@iota.org>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-graphql-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "iota-sdk-graphql-client"
version = "0.0.1-alpha.1"
authors = ["IOTA Foundation <info@iota.org>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
Expand Down
9 changes: 4 additions & 5 deletions crates/iota-sdk-graphql-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,15 +1312,14 @@ impl Client {
digest: digest.to_string(),
});
let response = self.run_query(&operation).await?;
if let Some(block) = response.transaction_block {
if block
if let Some(block) = response.transaction_block
&& block
.effects
.as_ref()
.and_then(|e| e.checkpoint.as_ref())
.is_some()
{
return Ok(true);
}
{
return Ok(true);
}
Ok(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,29 @@ impl std::fmt::Display for MoveFunction {
write!(f, "entry ")?;
}
write!(f, "{}", self.name)?;
if let Some(type_params) = &self.type_parameters {
if !type_params.is_empty() {
write!(f, "<")?;
for (i, param) in type_params.iter().enumerate() {
if i > 0 {
write!(f, ", ")?;
}
write!(f, "T{i}")?;
if !param.constraints.is_empty() {
write!(
f,
": {}",
param
.constraints
.iter()
.map(|v| v.to_string())
.collect::<Vec<_>>()
.join(" + ")
)?;
}
if let Some(type_params) = &self.type_parameters
&& !type_params.is_empty()
{
write!(f, "<")?;
for (i, param) in type_params.iter().enumerate() {
if i > 0 {
write!(f, ", ")?;
}
write!(f, "T{i}")?;
if !param.constraints.is_empty() {
write!(
f,
": {}",
param
.constraints
.iter()
.map(|v| v.to_string())
.collect::<Vec<_>>()
.join(" + ")
)?;
}
write!(f, ">")?;
}
write!(f, ">")?;
}
write!(f, "(")?;
if let Some(params) = &self.parameters {
Expand All @@ -91,21 +91,21 @@ impl std::fmt::Display for MoveFunction {
)?;
}
write!(f, ")")?;
if let Some(return_) = &self.return_ {
if !return_.is_empty() {
if return_.len() > 1 {
write!(
f,
" -> ({})",
return_
.iter()
.map(|v| v.repr.replace("$", "T"))
.collect::<Vec<_>>()
.join(", ")
)?;
} else {
write!(f, " -> {}", return_.first().unwrap().repr.replace("$", "T"))?;
}
if let Some(return_) = &self.return_
&& !return_.is_empty()
{
if return_.len() > 1 {
write!(
f,
" -> ({})",
return_
.iter()
.map(|v| v.repr.replace("$", "T"))
.collect::<Vec<_>>()
.join(", ")
)?;
} else {
write!(f, " -> {}", return_.first().unwrap().repr.replace("$", "T"))?;
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-transaction-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "iota-sdk-transaction-builder"
version = "0.0.1-alpha.1"
authors = ["IOTA Foundation <info@iota.org>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
description = "Transaction API for the IOTA Blockchain Rust SDK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ impl GasStationData {
) -> Result<serde_json::Value, Error> {
let client = reqwest::Client::new();
let reservation_id = match txn {
Transaction::V1(ref mut inner_txn) => {
Transaction::V1(inner_txn) => {
let reservation = self
.reserve_gas(inner_txn.gas_payment.budget, &client)
.await?;
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-sdk-transaction-builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,10 @@ impl<C: ClientMethods, L> TransactionBuilder<C, L> {
}
_ => &[],
} {
if let Argument::Input(idx) = arg {
if let Some(obj_id) = self.data.inputs[idx].object_id() {
unusable_object_ids.insert(*obj_id);
}
if let Argument::Input(idx) = arg
&& let Some(obj_id) = self.data.inputs[idx].object_id()
{
unusable_object_ids.insert(*obj_id);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "iota-sdk-types"
version = "0.0.1-alpha.1"
authors = ["IOTA Foundation <info@iota.org>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl schemars::JsonSchema for Address {
"Address".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
use schemars::schema::{InstanceType, Metadata, SchemaObject, StringValidation};

let hex_length = Address::LENGTH * 2;
Expand Down
12 changes: 8 additions & 4 deletions crates/iota-sdk-types/src/crypto/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,10 @@ mod serialization {
ReadableMemberPublicKey::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableMemberPublicKey::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableMemberPublicKey::json_schema(generator)
}
}

Expand Down Expand Up @@ -587,8 +589,10 @@ mod serialization {
ReadableMemberSignature::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableMemberSignature::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableMemberSignature::json_schema(generator)
}
}

Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk-types/src/crypto/passkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ mod serialization {
Authenticator::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
Authenticator::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
Authenticator::json_schema(generator)
}
}

Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk-types/src/crypto/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,10 @@ mod serialization {
ReadableUserSignature::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableUserSignature::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableUserSignature::json_schema(generator)
}
}

Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk-types/src/execution_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,10 @@ mod serialization {
ReadableExecutionStatus::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableExecutionStatus::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableExecutionStatus::json_schema(generator)
}
}

Expand Down
10 changes: 5 additions & 5 deletions crates/iota-sdk-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ mod _schemars {
"u64".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
SchemaObject {
metadata: Some(Box::new(Metadata {
description: Some("Radix-10 encoded 64-bit unsigned integer".to_owned()),
Expand All @@ -453,7 +453,7 @@ mod _schemars {
"i128".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
SchemaObject {
metadata: Some(Box::new(Metadata {
description: Some("Radix-10 encoded 128-bit signed integer".to_owned()),
Expand All @@ -478,7 +478,7 @@ mod _schemars {
"u256".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
SchemaObject {
metadata: Some(Box::new(Metadata {
description: Some("Radix-10 encoded 256-bit unsigned integer".to_owned()),
Expand All @@ -503,7 +503,7 @@ mod _schemars {
"Base64".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
SchemaObject {
metadata: Some(Box::new(Metadata {
description: Some("Base64 encoded data".to_owned()),
Expand All @@ -528,7 +528,7 @@ mod _schemars {
"Base58".to_owned()
}

fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
SchemaObject {
metadata: Some(Box::new(Metadata {
description: Some("Base58 encoded data".to_owned()),
Expand Down
12 changes: 8 additions & 4 deletions crates/iota-sdk-types/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ mod serialization {
ReadableObject::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableObject::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableObject::json_schema(generator)
}
}

Expand Down Expand Up @@ -902,8 +904,10 @@ mod serialization {
ReadableGenesisObject::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableGenesisObject::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableGenesisObject::json_schema(generator)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-types/src/serialization_proptests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn assert_valid_json_schema<T>(instance: &T)
where
T: serde::Serialize + schemars::JsonSchema,
{
let root_schema = schemars::gen::SchemaGenerator::default().into_root_schema_for::<T>();
let root_schema = schemars::r#gen::SchemaGenerator::default().into_root_schema_for::<T>();
let schema = serde_json::json!(root_schema);
let validator = jsonschema::Validator::new(&schema).unwrap();
let instance = serde_json::json!(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[package]
name = "update_transaction_fixtures"
version = "0.1.0"
edition = "2021"
edition = "2024"

[dependencies]
bcs.workspace = true
Expand Down
20 changes: 13 additions & 7 deletions crates/iota-sdk-types/src/transaction/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ mod transaction_kind {
ReadableTransactionKind::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableTransactionKind::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableTransactionKind::json_schema(generator)
}
}

Expand Down Expand Up @@ -555,7 +557,7 @@ mod argument {
"GasArgument".to_owned()
}

fn json_schema(_gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
schemars::schema::Schema::Object(schemars::schema::SchemaObject {
instance_type: Some(schemars::schema::InstanceType::String.into()),
enum_values: Some(vec!["gas".into()]),
Expand All @@ -574,8 +576,10 @@ mod argument {
ReadableArgument::schema_name()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
ReadableArgument::json_schema(gen)
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
ReadableArgument::json_schema(generator)
}
}

Expand Down Expand Up @@ -1001,7 +1005,9 @@ mod transaction_expiration {
"TransactionExpiration".into()
}

fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
use schemars::{
Map, Set,
schema::{
Expand All @@ -1015,7 +1021,7 @@ mod transaction_expiration {
let mut props = Map::new();
props.insert(
"epoch".to_owned(),
gen.subschema_for::<crate::_schemars::U64>(),
generator.subschema_for::<crate::_schemars::U64>(),
);
props
},
Expand Down
Loading