From fdafd9a7e17dd6fb5e9fd7f3427263c5c816c5cd Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 10:55:03 -0500 Subject: [PATCH] penumbra: `fmt` --- crates/bench/benches/spend.rs | 4 ++- .../bin/pcli/src/command/query/governance.rs | 7 +++--- crates/bin/pcli/src/command/tx.rs | 8 ++++-- .../bin/pcli/src/command/tx/auction/dutch.rs | 4 ++- crates/bin/pcli/src/terminal.rs | 4 ++- crates/bin/pcli/src/transaction_view_ext.rs | 8 ++++-- crates/bin/pcli/tests/proof.rs | 4 ++- .../bin/pclientd/tests/network_integration.rs | 13 +++++----- crates/bin/pd/src/cli.rs | 12 +++++++-- crates/bin/pd/src/main.rs | 25 ++++++++++--------- crates/bin/pd/src/network/generate.rs | 6 +++-- ..._can_define_and_delegate_to_a_validator.rs | 4 ++- .../app_can_disable_community_pool_spends.rs | 9 ++++--- .../app_can_undelegate_from_a_validator.rs | 4 ++- .../core/app/tests/common/ibc_tests/node.rs | 5 +++- crates/core/app/tests/common/mod.rs | 4 ++- .../app/tests/common/test_node_builder_ext.rs | 5 +++- crates/core/asset/src/asset.rs | 9 +++++-- .../core/component/dex/src/component/rpc.rs | 8 +++--- .../core/component/fee/src/component/rpc.rs | 4 ++- .../funding/src/component/metrics.rs | 3 ++- .../validator_handler/validator_store.rs | 4 ++- crates/core/transaction/src/view.rs | 4 ++- .../core/transaction/src/view/action_view.rs | 4 ++- .../proto/src/protobuf/tendermint_compat.rs | 8 ++++-- crates/test/mock-client/src/lib.rs | 5 +++- crates/view/src/worker.rs | 4 ++- 27 files changed, 122 insertions(+), 57 deletions(-) diff --git a/crates/bench/benches/spend.rs b/crates/bench/benches/spend.rs index 70f8f9fc9b..bbb77b70e9 100644 --- a/crates/bench/benches/spend.rs +++ b/crates/bench/benches/spend.rs @@ -9,7 +9,9 @@ use penumbra_sdk_asset::Value; use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use penumbra_sdk_proof_params::{DummyWitness, SPEND_PROOF_PROVING_KEY}; use penumbra_sdk_sct::Nullifier; -use penumbra_sdk_shielded_pool::{Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic}; +use penumbra_sdk_shielded_pool::{ + Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic, +}; use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/crates/bin/pcli/src/command/query/governance.rs b/crates/bin/pcli/src/command/query/governance.rs index 93a0decb65..6fb05a7209 100644 --- a/crates/bin/pcli/src/command/query/governance.rs +++ b/crates/bin/pcli/src/command/query/governance.rs @@ -188,10 +188,9 @@ impl GovernanceCmd { .tally .expect("tally must be set for vote response") .try_into()?; - Ok::<(IdentityKey, penumbra_sdk_governance::Tally), anyhow::Error>(( - identity_key, - tally, - )) + Ok::<(IdentityKey, penumbra_sdk_governance::Tally), anyhow::Error>( + (identity_key, tally), + ) }) // TODO: double iterator here is suboptimal but trying to collect // `Result>` was annoying diff --git a/crates/bin/pcli/src/command/tx.rs b/crates/bin/pcli/src/command/tx.rs index 0a4cccd2c9..90cc0e1661 100644 --- a/crates/bin/pcli/src/command/tx.rs +++ b/crates/bin/pcli/src/command/tx.rs @@ -29,7 +29,9 @@ use liquidity_position::PositionCmd; use penumbra_sdk_asset::{asset, asset::Metadata, Value, STAKING_TOKEN_ASSET_ID}; use penumbra_sdk_dex::{lp::position, swap_claim::SwapClaimPlan}; use penumbra_sdk_fee::FeeTier; -use penumbra_sdk_governance::{proposal::ProposalToml, proposal_state::State as ProposalState, Vote}; +use penumbra_sdk_governance::{ + proposal::ProposalToml, proposal_state::State as ProposalState, Vote, +}; use penumbra_sdk_keys::{keys::AddressIndex, Address}; use penumbra_sdk_num::Amount; use penumbra_sdk_proto::{ @@ -64,7 +66,9 @@ use penumbra_sdk_proto::{ }; use penumbra_sdk_shielded_pool::Ics20Withdrawal; use penumbra_sdk_stake::rate::RateData; -use penumbra_sdk_stake::{DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan}; +use penumbra_sdk_stake::{ + DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan, +}; use penumbra_sdk_transaction::{gas::swap_claim_gas_cost, Transaction}; use penumbra_sdk_view::{SpendableNoteRecord, ViewClient}; use penumbra_sdk_wallet::plan::{self, Planner}; diff --git a/crates/bin/pcli/src/command/tx/auction/dutch.rs b/crates/bin/pcli/src/command/tx/auction/dutch.rs index 66a2964a78..4d2f0bb9af 100644 --- a/crates/bin/pcli/src/command/tx/auction/dutch.rs +++ b/crates/bin/pcli/src/command/tx/auction/dutch.rs @@ -8,7 +8,9 @@ use clap::Subcommand; use comfy_table::presets; use dialoguer::Confirm; use penumbra_sdk_asset::{asset::Cache, Value}; -use penumbra_sdk_auction::auction::{dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId}; +use penumbra_sdk_auction::auction::{ + dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId, +}; use penumbra_sdk_keys::keys::AddressIndex; use penumbra_sdk_num::Amount; use penumbra_sdk_proto::{view::v1::GasPricesRequest, DomainType}; diff --git a/crates/bin/pcli/src/terminal.rs b/crates/bin/pcli/src/terminal.rs index 461906da3a..69dea541d0 100644 --- a/crates/bin/pcli/src/terminal.rs +++ b/crates/bin/pcli/src/terminal.rs @@ -94,7 +94,9 @@ fn pretty_print_transaction_plan( output::Output { body: output::Body { note_payload: penumbra_sdk_shielded_pool::NotePayload { - note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment( + Fq::default(), + ), ephemeral_key: [0u8; 32] .as_slice() .try_into() diff --git a/crates/bin/pcli/src/transaction_view_ext.rs b/crates/bin/pcli/src/transaction_view_ext.rs index ee059727e3..a1b925a2e9 100644 --- a/crates/bin/pcli/src/transaction_view_ext.rs +++ b/crates/bin/pcli/src/transaction_view_ext.rs @@ -377,7 +377,9 @@ impl TransactionViewExt for TransactionView { penumbra_sdk_transaction::ActionView::PositionWithdraw(_) => { ["Withdraw Liquitity Position", ""] } - penumbra_sdk_transaction::ActionView::ProposalDepositClaim(proposal_deposit_claim) => { + penumbra_sdk_transaction::ActionView::ProposalDepositClaim( + proposal_deposit_claim, + ) => { action = format!( "Claim Deposit for Governance Proposal #{}", proposal_deposit_claim.proposal @@ -415,7 +417,9 @@ impl TransactionViewExt for TransactionView { } penumbra_sdk_transaction::ActionView::Delegate(_) => ["Delegation", ""], penumbra_sdk_transaction::ActionView::Undelegate(_) => ["Undelegation", ""], - penumbra_sdk_transaction::ActionView::UndelegateClaim(_) => ["Undelegation Claim", ""], + penumbra_sdk_transaction::ActionView::UndelegateClaim(_) => { + ["Undelegation Claim", ""] + } penumbra_sdk_transaction::ActionView::ActionDutchAuctionSchedule(x) => { let description = &x.action.description; diff --git a/crates/bin/pcli/tests/proof.rs b/crates/bin/pcli/tests/proof.rs index 936a66c9a1..513d617f63 100644 --- a/crates/bin/pcli/tests/proof.rs +++ b/crates/bin/pcli/tests/proof.rs @@ -31,7 +31,9 @@ use penumbra_sdk_shielded_pool::{ NullifierDerivationProof, NullifierDerivationProofPrivate, NullifierDerivationProofPublic, OutputProof, SpendProof, SpendProofPrivate, SpendProofPublic, }; -use penumbra_sdk_stake::undelegate_claim::{UndelegateClaimProofPrivate, UndelegateClaimProofPublic}; +use penumbra_sdk_stake::undelegate_claim::{ + UndelegateClaimProofPrivate, UndelegateClaimProofPublic, +}; use penumbra_sdk_stake::{IdentityKey, Penalty, UnbondingToken, UndelegateClaimProof}; use penumbra_sdk_tct as tct; use rand_core::OsRng; diff --git a/crates/bin/pclientd/tests/network_integration.rs b/crates/bin/pclientd/tests/network_integration.rs index 0ca9116f74..c4a783096c 100644 --- a/crates/bin/pclientd/tests/network_integration.rs +++ b/crates/bin/pclientd/tests/network_integration.rs @@ -314,12 +314,13 @@ async fn swap_claim_flow() -> anyhow::Result<()> { .ok_or_else(|| anyhow::anyhow!("TransactionPlannerResponse missing plan"))?; // Hold on to the swap plaintext to be able to claim. - let swap_plaintext = TryInto::::try_into(plan.clone())? - .swap_plans() - .next() - .expect("swap plan must be present") - .swap_plaintext - .clone(); + let swap_plaintext = + TryInto::::try_into(plan.clone())? + .swap_plans() + .next() + .expect("swap plan must be present") + .swap_plaintext + .clone(); // 5.2. Get authorization data for the transaction from pclientd (signing). let auth_data = custody_client diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index f406e82b83..641117a245 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -236,10 +236,18 @@ pub enum NetworkCommand { #[clap(long, env = "penumbra_sdk_PD_TM_EXTERNAL_ADDR")] external_address: Option, /// When generating Tendermint config, use this socket to bind the Tendermint RPC service. - #[clap(long, env = "penumbra_sdk_PD_TM_RPC_BIND", default_value = "0.0.0.0:26657")] + #[clap( + long, + env = "penumbra_sdk_PD_TM_RPC_BIND", + default_value = "0.0.0.0:26657" + )] tendermint_rpc_bind: SocketAddr, /// When generating Tendermint config, use this socket to bind the Tendermint P2P service. - #[clap(long, env = "penumbra_sdk_PD_TM_P2P_BIND", default_value = "0.0.0.0:26656")] + #[clap( + long, + env = "penumbra_sdk_PD_TM_P2P_BIND", + default_value = "0.0.0.0:26656" + )] tendermint_p2p_bind: SocketAddr, /// Leave the downloaded archive file on disk after extraction. #[clap(long, env = "penumbra_sdk_PD_LEAVE_ARCHIVE", action)] diff --git a/crates/bin/pd/src/main.rs b/crates/bin/pd/src/main.rs index c812ca435a..c856d2ddb1 100644 --- a/crates/bin/pd/src/main.rs +++ b/crates/bin/pd/src/main.rs @@ -133,18 +133,19 @@ async fn main() -> anyhow::Result<()> { let tm_proxy = penumbra_sdk_tendermint_proxy::TendermintProxy::new(cometbft_addr); - let grpc_routes = penumbra_sdk_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? - .into_axum_router() - .layer( - ServiceBuilder::new().layer(TraceLayer::new_for_grpc().make_span_with( - |req: &http::Request<_>| match remote_addr(req) { - Some(remote_addr) => { - tracing::error_span!("grpc", ?remote_addr) - } - None => tracing::error_span!("grpc"), - }, - )), - ); + let grpc_routes = + penumbra_sdk_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? + .into_axum_router() + .layer( + ServiceBuilder::new().layer(TraceLayer::new_for_grpc().make_span_with( + |req: &http::Request<_>| match remote_addr(req) { + Some(remote_addr) => { + tracing::error_span!("grpc", ?remote_addr) + } + None => tracing::error_span!("grpc"), + }, + )), + ); // Create Axum routes for the frontend app. let frontend = pd::zipserve::router("/app/", pd::MINIFRONT_ARCHIVE_BYTES); diff --git a/crates/bin/pd/src/network/generate.rs b/crates/bin/pd/src/network/generate.rs index a21e73937e..0c92549dec 100644 --- a/crates/bin/pd/src/network/generate.rs +++ b/crates/bin/pd/src/network/generate.rs @@ -773,7 +773,8 @@ mod tests { assert_eq!(testnet_config.name, "test-chain-1234"); assert_eq!(testnet_config.genesis.validators.len(), 0); // No external address template was given, so only 1 validator will be present. - let penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = + testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; @@ -803,7 +804,8 @@ mod tests { )?; assert_eq!(testnet_config.name, "test-chain-4567"); assert_eq!(testnet_config.genesis.validators.len(), 0); - let penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = + testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; diff --git a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs index efad2e947c..4aa6971582 100644 --- a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs +++ b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs @@ -82,7 +82,9 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the existing validator is and was active. { - use penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead, validator::State}; + use penumbra_sdk_stake::{ + component::validator_handler::ValidatorDataRead, validator::State, + }; let start = snapshot_start .get_validator_state(&existing_validator_id) .await?; diff --git a/crates/core/app/tests/app_can_disable_community_pool_spends.rs b/crates/core/app/tests/app_can_disable_community_pool_spends.rs index 75b8a4ccbc..9fd55f8df5 100644 --- a/crates/core/app/tests/app_can_disable_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_disable_community_pool_spends.rs @@ -123,10 +123,11 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { }, }, community_pool_content: penumbra_sdk_community_pool::genesis::Content { - community_pool_params: penumbra_sdk_community_pool::params::CommunityPoolParameters { - // Disable community spend proposals. - community_pool_spend_proposals_enabled: false, - }, + community_pool_params: + penumbra_sdk_community_pool::params::CommunityPoolParameters { + // Disable community spend proposals. + community_pool_spend_proposals_enabled: false, + }, ..Default::default() }, ..Default::default() diff --git a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs index 716ad717d8..27b79aadad 100644 --- a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs +++ b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs @@ -14,7 +14,9 @@ use { penumbra_sdk_num::fixpoint::U128x128, penumbra_sdk_proto::DomainType, penumbra_sdk_sct::component::clock::EpochRead as _, - penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan}, + penumbra_sdk_stake::{ + component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan, + }, penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, diff --git a/crates/core/app/tests/common/ibc_tests/node.rs b/crates/core/app/tests/common/ibc_tests/node.rs index f39d2f4dfa..7ae02619d2 100644 --- a/crates/core/app/tests/common/ibc_tests/node.rs +++ b/crates/core/app/tests/common/ibc_tests/node.rs @@ -212,7 +212,10 @@ impl TestNodeWithIBC { pub fn create_tendermint_header( &self, trusted_height: Option, - penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse{block_id: _, block}: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, + penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse { + block_id: _, + block, + }: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, ) -> Result { let pk = self .node diff --git a/crates/core/app/tests/common/mod.rs b/crates/core/app/tests/common/mod.rs index c2dfcc6a05..58b1e162ab 100644 --- a/crates/core/app/tests/common/mod.rs +++ b/crates/core/app/tests/common/mod.rs @@ -7,7 +7,9 @@ pub use { temp_storage_ext::TempStorageExt, test_node_builder_ext::BuilderExt, test_node_ext::TestNodeExt, validator_read_ext::ValidatorDataReadExt, }, - penumbra_sdk_test_subscriber::{set_tracing_subscriber, set_tracing_subscriber_with_env_filter}, + penumbra_sdk_test_subscriber::{ + set_tracing_subscriber, set_tracing_subscriber_with_env_filter, + }, }; /// Penumbra-specific extensions to the mock consensus builder. diff --git a/crates/core/app/tests/common/test_node_builder_ext.rs b/crates/core/app/tests/common/test_node_builder_ext.rs index 81865651f0..f2f9aa4f6b 100644 --- a/crates/core/app/tests/common/test_node_builder_ext.rs +++ b/crates/core/app/tests/common/test_node_builder_ext.rs @@ -26,7 +26,10 @@ pub trait BuilderExt: Sized { impl BuilderExt for Builder { type Error = anyhow::Error; - fn with_penumbra_sdk_auto_app_state(mut self, app_state: AppState) -> Result { + fn with_penumbra_sdk_auto_app_state( + mut self, + app_state: AppState, + ) -> Result { let Self { keyring, .. } = &self; let mut content = match app_state { AppState::Content(c) => c, diff --git a/crates/core/asset/src/asset.rs b/crates/core/asset/src/asset.rs index f40da0aa74..a672021f60 100644 --- a/crates/core/asset/src/asset.rs +++ b/crates/core/asset/src/asset.rs @@ -118,7 +118,10 @@ mod tests { penumbra_sdk_display_denom.format_value(6700001u64.into()), "6.700001" ); - assert_eq!(penumbra_sdk_display_denom.format_value(1u64.into()), "0.000001"); + assert_eq!( + penumbra_sdk_display_denom.format_value(1u64.into()), + "0.000001" + ); // with exponent 3, 1782000 formats to 1782 let mpenumbra_sdk_display_denom = REGISTRY.parse_unit("mpenumbra"); @@ -183,7 +186,9 @@ mod tests { mpenumbra_sdk_display_denom.parse_value("1782").unwrap(), 1782000u64.into() ); - assert!(mpenumbra_sdk_display_denom.parse_value("1782.0001").is_err()); + assert!(mpenumbra_sdk_display_denom + .parse_value("1782.0001") + .is_err()); let upenumbra_sdk_display_denom = REGISTRY.parse_unit("upenumbra"); assert_eq!( diff --git a/crates/core/component/dex/src/component/rpc.rs b/crates/core/component/dex/src/component/rpc.rs index 46853854c4..0bfd3df7b3 100644 --- a/crates/core/component/dex/src/component/rpc.rs +++ b/crates/core/component/dex/src/component/rpc.rs @@ -571,9 +571,11 @@ impl QueryService for Server { } }; Ok(tonic::Response::new( - s.map_ok(|p: penumbra_sdk_proto::core::component::dex::v1::Position| { - LiquidityPositionsByIdResponse { data: Some(p) } - }) + s.map_ok( + |p: penumbra_sdk_proto::core::component::dex::v1::Position| { + LiquidityPositionsByIdResponse { data: Some(p) } + }, + ) .map_err(|e: anyhow::Error| { tonic::Status::unavailable(format!( "error getting position value from storage: {e}" diff --git a/crates/core/component/fee/src/component/rpc.rs b/crates/core/component/fee/src/component/rpc.rs index f1dea0f2ff..fd9291a420 100644 --- a/crates/core/component/fee/src/component/rpc.rs +++ b/crates/core/component/fee/src/component/rpc.rs @@ -1,6 +1,8 @@ use async_trait::async_trait; use cnidarium::Storage; -use penumbra_sdk_proto::core::component::fee::v1::{self as pb, query_service_server::QueryService}; +use penumbra_sdk_proto::core::component::fee::v1::{ + self as pb, query_service_server::QueryService, +}; use super::StateReadExt; diff --git a/crates/core/component/funding/src/component/metrics.rs b/crates/core/component/funding/src/component/metrics.rs index 4cf6edc71b..8adafcc9ce 100644 --- a/crates/core/component/funding/src/component/metrics.rs +++ b/crates/core/component/funding/src/component/metrics.rs @@ -40,7 +40,8 @@ pub fn register_metrics() { ); } -pub const TOTAL_VALIDATOR_REWARDS: &str = "penumbra_sdk_funding_total_validator_rewards_staking_token"; +pub const TOTAL_VALIDATOR_REWARDS: &str = + "penumbra_sdk_funding_total_validator_rewards_staking_token"; pub const VALIDATOR_FUNDING_VS_BUDGET_DIFFERENCE: &str = "penumbra_sdk_funding_validator_vs_budget_difference_staking_token"; pub const FETCH_FUNDING_QUEUE_LATENCY: &str = diff --git a/crates/core/component/stake/src/component/validator_handler/validator_store.rs b/crates/core/component/stake/src/component/validator_handler/validator_store.rs index 845724fe80..ef1c5845d7 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_store.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_store.rs @@ -11,7 +11,9 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::{Future, FutureExt}; use penumbra_sdk_num::Amount; -use penumbra_sdk_proto::{state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{ + state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto, +}; use std::pin::Pin; use tendermint::PublicKey; use tracing::instrument; diff --git a/crates/core/transaction/src/view.rs b/crates/core/transaction/src/view.rs index 5e0540e1bb..14ca9e95b6 100644 --- a/crates/core/transaction/src/view.rs +++ b/crates/core/transaction/src/view.rs @@ -536,7 +536,9 @@ mod test { output::Output { body: output::Body { note_payload: penumbra_sdk_shielded_pool::NotePayload { - note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment( + Fq::default(), + ), ephemeral_key: [0u8; 32] .as_slice() .try_into() diff --git a/crates/core/transaction/src/view/action_view.rs b/crates/core/transaction/src/view/action_view.rs index 938ffd5249..d06f98d2ed 100644 --- a/crates/core/transaction/src/view/action_view.rs +++ b/crates/core/transaction/src/view/action_view.rs @@ -8,7 +8,9 @@ use penumbra_sdk_dex::{ swap::SwapView, swap_claim::SwapClaimView, }; -use penumbra_sdk_governance::{ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote}; +use penumbra_sdk_governance::{ + ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, +}; use penumbra_sdk_ibc::IbcRelay; use penumbra_sdk_proto::{core::transaction::v1 as pbt, DomainType}; use penumbra_sdk_shielded_pool::Ics20Withdrawal; diff --git a/crates/proto/src/protobuf/tendermint_compat.rs b/crates/proto/src/protobuf/tendermint_compat.rs index 5fbe0eab73..e4081c5e3a 100644 --- a/crates/proto/src/protobuf/tendermint_compat.rs +++ b/crates/proto/src/protobuf/tendermint_compat.rs @@ -273,7 +273,9 @@ pub struct HeightOverflowError { source: >::Error, } -impl TryFrom for penumbra_sdk_pb::AbciQueryResponse { +impl TryFrom + for penumbra_sdk_pb::AbciQueryResponse +{ type Error = HeightOverflowError; fn try_from( tendermint_rpc::endpoint::abci_query::AbciQuery { @@ -338,7 +340,9 @@ impl From for crate::tendermint::crypto::Pro // === get_block_by_height === -impl TryFrom for penumbra_sdk_pb::GetBlockByHeightResponse { +impl TryFrom + for penumbra_sdk_pb::GetBlockByHeightResponse +{ type Error = anyhow::Error; fn try_from( tendermint_rpc::endpoint::block::Response { diff --git a/crates/test/mock-client/src/lib.rs b/crates/test/mock-client/src/lib.rs index 2903697835..a40c0a84c9 100644 --- a/crates/test/mock-client/src/lib.rs +++ b/crates/test/mock-client/src/lib.rs @@ -210,7 +210,10 @@ impl MockClient { self.swaps.get(commitment).cloned() } - pub fn position(&self, commitment: note::StateCommitment) -> Option { + pub fn position( + &self, + commitment: note::StateCommitment, + ) -> Option { self.sct.witness(commitment).map(|proof| proof.position()) } diff --git a/crates/view/src/worker.rs b/crates/view/src/worker.rs index 103ce77cb5..9126773ef0 100644 --- a/crates/view/src/worker.rs +++ b/crates/view/src/worker.rs @@ -298,7 +298,9 @@ impl Worker { .update_position(position_id, position::State::Closed) .await?; } - penumbra_sdk_transaction::Action::PositionWithdraw(position_withdraw) => { + penumbra_sdk_transaction::Action::PositionWithdraw( + position_withdraw, + ) => { let position_id = position_withdraw.position_id; // Record the LPNFT for the current sequence number.