Skip to content

Commit

Permalink
Fix even more clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgitiota committed Jan 7, 2025
1 parent f46876f commit f4e7a99
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

use serde::Serialize;

use bcs;

use crate::rebased::Error;
use identity_iota_interaction::ident_str;
use identity_iota_interaction::types::programmable_transaction_builder::ProgrammableTransactionBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use std::collections::HashSet;
use std::str::FromStr;

use bcs;

use identity_iota_interaction::{IdentityMoveCalls, ProgrammableTransactionBcs, TransactionBuilderT,
BorrowIntentFnT, ControllerIntentFnT};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<'a> QuorumDriverTrait for QuorumDriverAdapter<'a> {
) -> IotaRpcResult<IotaTransactionBlockResponseAdaptedTraitObj> {
let tx_data = bcs::from_bytes::<TransactionData>(tx_data_bcs.as_slice())?;
let signatures_vec = signatures
.into_iter()
.iter()
.map(|signature_bcs| bcs::from_bytes::<Signature>(signature_bcs.as_slice()))
.collect::<Result<Vec<Signature>, _>>()?;
let tx = Transaction::from_data(tx_data, signatures_vec);
Expand Down Expand Up @@ -412,7 +412,7 @@ impl IotaClientRustSdk {
) -> Result<IotaTransactionBlockResponse, Error> {
let gas_budget = match gas_budget {
Some(gas) => gas,
None => self.sdk_default_gas_budget(sender_address.clone(), &tx).await?,
None => self.sdk_default_gas_budget(sender_address, &tx).await?,
};
let tx_data = self.get_transaction_data(tx, gas_budget, sender_address).await?;
let signature = Self::sign_transaction_data(signer, &tx_data, sender_public_key).await?;
Expand Down Expand Up @@ -451,7 +451,7 @@ impl IotaClientRustSdk {
.get_reference_gas_price()
.await
.map_err(|e| Error::RpcError(e.to_string()))?;
let gas_coin = self.get_coin_for_transaction(sender_address.clone()).await?;
let gas_coin = self.get_coin_for_transaction(sender_address).await?;
let tx_data = TransactionData::new_programmable(
sender_address,
vec![gas_coin.object_ref()],
Expand Down Expand Up @@ -492,7 +492,7 @@ impl IotaClientRustSdk {
.get_reference_gas_price()
.await
.map_err(|err| Error::GasIssue(format!("could not get gas price; {err}")))?;
let coin = self.get_coin_for_transaction(sender_address.clone()).await?;
let coin = self.get_coin_for_transaction(sender_address).await?;
let tx_data = TransactionData::new_programmable(
sender_address,
vec![coin.object_ref()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use identity_iota_interaction::types::programmable_transaction_builder::Programm
use identity_iota_interaction::ProgrammableTransactionBcs;
use identity_iota_interaction::TransactionBuilderT;

#[derive(Default)]
pub(crate) struct TransactionBuilderRustSdk {
pub(crate) builder: ProgrammableTransactionBuilder,
}
Expand Down Expand Up @@ -36,14 +37,6 @@ impl TransactionBuilderT for TransactionBuilderRustSdk {
}
}

impl Default for TransactionBuilderRustSdk {
fn default() -> Self {
TransactionBuilderRustSdk {
builder: ProgrammableTransactionBuilder::default(),
}
}
}

impl Deref for TransactionBuilderRustSdk {
type Target = ProgrammableTransactionBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl PublicAvailableVC {
}

fn try_from_asset(asset: AuthenticatedAsset<IotaVerifiableCredential>) -> Result<Self, anyhow::Error> {
let credential = parse_jwt_credential(&asset.content().data())?;
let credential = parse_jwt_credential(asset.content().data())?;
Ok(Self { asset, credential })
}
}
Expand Down

0 comments on commit f4e7a99

Please sign in to comment.