Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranduy1dol committed Aug 6, 2024
1 parent dac441c commit 514e81e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions crates/da-clients/aptos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use aptos_sdk::crypto::HashValue;
use aptos_sdk::move_types::account_address::AccountAddress;
use aptos_sdk::move_types::identifier::Identifier;
use aptos_sdk::move_types::language_storage::ModuleId;
use aptos_sdk::move_types::value::{MoveValue, serialize_values};
use aptos_sdk::move_types::value::{serialize_values, MoveValue};
use aptos_sdk::rest_client::Client;
use aptos_sdk::types::chain_id::ChainId;
use aptos_sdk::types::LocalAccount;
use aptos_sdk::types::transaction::{EntryFunction, TransactionPayload};
use aptos_sdk::types::LocalAccount;
use async_trait::async_trait;
use c_kzg::{Blob, BYTES_PER_BLOB, KzgCommitment, KzgProof, KzgSettings};
use c_kzg::{Blob, KzgCommitment, KzgProof, KzgSettings, BYTES_PER_BLOB};

use da_client_interface::{DaClient, DaVerificationStatus};
use utils::env_utils::get_env_var_or_panic;
Expand Down Expand Up @@ -74,7 +74,7 @@ impl DaClient for AptosDaClient {
Identifier::new(BLOB_SUBMISSION).unwrap(),
vec![],
serialize_values(vec![
&MoveValue::Vector(blobs.get(0).unwrap().get(i).unwrap().to_vec()),
&MoveValue::Vector(blobs.first().unwrap().get(i).unwrap().to_vec()),
&MoveValue::Vector(commitments.clone()),
&MoveValue::Vector(proofs.clone()),
]),
Expand All @@ -89,8 +89,8 @@ impl DaClient for AptosDaClient {
.map(|tx| {
let client = self.client.clone();
tokio::spawn(async move {
let init_tx = client.submit(&tx).await.unwrap().into_inner();
init_tx

client.submit(&tx).await.unwrap().into_inner()
})
})
.collect::<Vec<_>>();
Expand All @@ -117,7 +117,7 @@ impl DaClient for AptosDaClient {
let mut hashes_combined: String = "".to_string();
for handle in results {
let hash = handle.await.unwrap();
hashes_combined.push_str(&*hash);
hashes_combined.push_str(&hash);
}

Ok(hashes_combined)
Expand Down Expand Up @@ -161,7 +161,7 @@ async fn prepare_blob(

let commitment = KzgCommitment::blob_to_kzg_commitment(&blob, trusted_setup)?;
let proof = KzgProof::compute_blob_kzg_proof(&blob, &commitment.to_bytes(), trusted_setup)?;

result.push((
FixedBytes::new(fixed_size_blob),
FixedBytes::new(commitment.to_bytes().into_inner()),
Expand All @@ -173,11 +173,11 @@ async fn prepare_blob(

#[cfg(test)]
mod test {
use std::time::{SystemTime, UNIX_EPOCH};
use alloy::hex;
use aptos_sdk::move_types::u256;
use aptos_sdk::transaction_builder::TransactionBuilder;
use da_client_interface::DaConfig;
use std::time::{SystemTime, UNIX_EPOCH};

use crate::config::AptosDaConfig;

Expand Down
2 changes: 1 addition & 1 deletion crates/orchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ path = "src/main.rs"

[dependencies]
alloy = { workspace = true }
aptos-da-client = { workspace = true, optional = true }
arc-swap = { workspace = true }
async-std = "1.12.0"
async-trait = { workspace = true }
Expand All @@ -28,7 +29,6 @@ color-eyre = { workspace = true }
da-client-interface = { workspace = true }
dotenvy = { workspace = true }
ethereum-da-client = { workspace = true, optional = true }
aptos-da-client = { workspace = true, optional = true }
ethereum-settlement-client = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
Expand Down

0 comments on commit 514e81e

Please sign in to comment.