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

proto: align proto packages to rust crates #3077

Merged
merged 7 commits into from
Sep 22, 2023
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/bin/pcli/src/command/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use penumbra_proto::{
EpochByHeightRequest, LiquidityPositionByIdRequest, ProposalInfoRequest,
ProposalInfoResponse, ProposalRateDataRequest, ValidatorPenaltyRequest,
},
core::dex::v1alpha1::PositionId,
core::component::dex::v1alpha1::PositionId,
};
use penumbra_stake::rate::RateData;
use penumbra_stake::{DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan};
Expand Down
4 changes: 3 additions & 1 deletion crates/bin/pcli/src/command/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use anyhow::{Context, Result};
use penumbra_fee::Fee;
use penumbra_governance::{ValidatorVote, ValidatorVoteBody, Vote};
use penumbra_keys::keys::AddressIndex;
use penumbra_proto::{core::stake::v1alpha1::Validator as ProtoValidator, DomainType, Message};
use penumbra_proto::{
core::component::stake::v1alpha1::Validator as ProtoValidator, DomainType, Message,
};
use penumbra_stake::{
validator,
validator::{Validator, ValidatorToml},
Expand Down
6 changes: 3 additions & 3 deletions crates/bin/pclientd/tests/network_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use penumbra_asset::{asset, Value, STAKING_TOKEN_ASSET_ID};
use penumbra_chain::test_keys;
use penumbra_custody::soft_kms;
use penumbra_proto::{
core::{crypto::v1alpha1::Fee, ibc::v1alpha1::IbcAction},
core::{component::fee::v1alpha1::Fee, component::ibc::v1alpha1::IbcAction},
custody::v1alpha1::{
custody_protocol_service_client::CustodyProtocolServiceClient, AuthorizeRequest,
},
Expand Down Expand Up @@ -230,7 +230,7 @@ async fn swap_claim_flow() -> anyhow::Result<()> {
// Here we don't want to use the Penumbra Rust libraries much, because
// we're executing as if we were a Go program that had to construct all these
// protos manually, with no access to Penumbra crypto.
use penumbra_proto::core::crypto::v1alpha1 as crypto;
use penumbra_proto::core::num::v1alpha1 as num;
use penumbra_proto::view::v1alpha1::transaction_planner_request as tpr;

// 5.1. Generate a transaction plan performing a swap. Since there are no liquidity positions
Expand All @@ -252,7 +252,7 @@ async fn swap_claim_flow() -> anyhow::Result<()> {
),
target_asset: Some(gm.into()),
fee: Some(Fee {
amount: Some(crypto::Amount { lo: 0, hi: 0 }),
amount: Some(num::Amount { lo: 0, hi: 0 }),
asset_id: None,
}),
claim_address: Some(test_keys::ADDRESS_1.clone().into()),
Expand Down
8 changes: 5 additions & 3 deletions crates/bin/pd/src/info/specific.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@ impl SpecificQueryService for Info {
}
};
Ok(tonic::Response::new(
s.map_ok(|p: penumbra_proto::core::dex::v1alpha1::Position| {
LiquidityPositionsByIdResponse { data: Some(p) }
})
s.map_ok(
|p: penumbra_proto::core::component::dex::v1alpha1::Position| {
LiquidityPositionsByIdResponse { data: Some(p) }
},
)
.map_err(|e: anyhow::Error| {
tonic::Status::unavailable(format!(
"error getting position value from storage: {e}"
Expand Down
2 changes: 1 addition & 1 deletion crates/core/asset/src/asset/denom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use penumbra_proto::{core::crypto::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::asset::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};
/// An asset denomination.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/core/asset/src/asset/denom_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use ark_ff::fields::PrimeField;
use decaf377::Fq;
use penumbra_num::Amount;
use penumbra_proto::{
core::crypto::v1alpha1 as pb, view::v1alpha1::AssetsResponse, DomainType, TypeUrl,
penumbra::core::asset::v1alpha1 as pb, view::v1alpha1::AssetsResponse, DomainType, TypeUrl,
};
use serde::{Deserialize, Serialize};

Expand Down
4 changes: 3 additions & 1 deletion crates/core/asset/src/asset/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use ark_serialize::CanonicalDeserialize;
use decaf377::{FieldExt, Fq};
use once_cell::sync::Lazy;
use penumbra_num::Amount;
use penumbra_proto::{core::crypto::v1alpha1 as pb, serializers::bech32str, DomainType, TypeUrl};
use penumbra_proto::{
penumbra::core::asset::v1alpha1 as pb, serializers::bech32str, DomainType, TypeUrl,
};
use serde::{Deserialize, Serialize};

use crate::Value;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/asset/src/balance/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use decaf377::r1cs::ElementVar;
use decaf377::Fq;
use decaf377::Fr;
use once_cell::sync::Lazy;
use penumbra_proto::core::crypto::v1alpha1 as pb;
use penumbra_proto::penumbra::core::asset::v1alpha1 as pb;
use penumbra_proto::{DomainType, TypeUrl};

use crate::value::ValueVar;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/asset/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{

use anyhow::Context;
use penumbra_num::{Amount, AmountVar};
use penumbra_proto::{core::crypto::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::asset::v1alpha1 as pb, DomainType, TypeUrl};
use regex::Regex;
use serde::{Deserialize, Serialize};

Expand Down
4 changes: 3 additions & 1 deletion crates/core/component/chain/src/effect_hash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use penumbra_proto::{core::crypto::v1alpha1 as pb_crypto, DomainType, TypeUrl};
use penumbra_proto::{
penumbra::core::component::chain::v1alpha1 as pb_crypto, DomainType, TypeUrl,
};

/// Something that can be hashed to produce an [`EffectHash`].
pub trait EffectingData {
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/chain/src/epoch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use penumbra_proto::{core::chain::v1alpha1 as pb_chain, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::chain::v1alpha1 as pb_chain, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

/// Penumbra groups blocks into epochs and restricts validator changes to epoch boundaries.
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/chain/src/genesis/allocation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use penumbra_keys::Address;
use penumbra_num::Amount;
use penumbra_proto::{core::chain::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::chain::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

/// A (transparent) genesis allocation.
Expand Down
6 changes: 5 additions & 1 deletion crates/core/component/chain/src/genesis/app_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use anyhow::Context;
use penumbra_proto::{
core::chain::v1alpha1 as pb, core::stake::v1alpha1 as pb_stake, DomainType, TypeUrl,
// TODO: avoid this import!
core::component::stake::v1alpha1 as pb_stake,
penumbra::core::component::chain::v1alpha1 as pb,
DomainType,
TypeUrl,
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/chain/src/known_assets.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use penumbra_asset::asset::{self, DenomMetadata};
use penumbra_proto::{core::chain::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::chain::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Default, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/chain/src/note_source.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{anyhow, Result};
use penumbra_proto::{core::chain::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::chain::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
Expand Down
3 changes: 2 additions & 1 deletion crates/core/component/chain/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ use std::{
use anyhow::Context;
use penumbra_num::Amount;
use penumbra_proto::client::v1alpha1 as pb_client;
use penumbra_proto::core::chain::v1alpha1 as pb_chain;
use penumbra_proto::penumbra::core::component::chain::v1alpha1 as pb_chain;

use penumbra_proto::view::v1alpha1 as pb_view;
use penumbra_proto::{DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

pub mod change;

// TODO: lift into the App
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(
try_from = "pb_chain::ChainParameters",
Expand Down
3 changes: 2 additions & 1 deletion crates/core/component/compact-block/src/compact_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use anyhow::Result;
use penumbra_chain::params::{ChainParameters, FmdParameters};
use penumbra_dex::{BatchSwapOutputData, TradingPair};
use penumbra_proto::{
client::v1alpha1::CompactBlockRangeResponse, core::chain::v1alpha1 as pb, DomainType, TypeUrl,
client::v1alpha1::CompactBlockRangeResponse,
penumbra::core::component::compact_block::v1alpha1 as pb, DomainType, TypeUrl,
};
use penumbra_sct::Nullifier;
use penumbra_tct::builder::{block, epoch};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/compact-block/src/state_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::convert::TryFrom;

use anyhow::Result;
use penumbra_dex::swap::SwapPayload;
use penumbra_proto::core::chain::v1alpha1::{self as pb};
use penumbra_proto::penumbra::core::component::compact_block::v1alpha1::{self as pb};
use penumbra_shielded_pool::{note, NotePayload};

use serde::{Deserialize, Serialize};
Expand Down
3 changes: 2 additions & 1 deletion crates/core/component/dao/src/action/dao_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use serde::{Deserialize, Serialize};
use std::convert::{TryFrom, TryInto};

use penumbra_asset::{Balance, Value};
use penumbra_proto::{core::governance::v1alpha1 as pb, DomainType, TypeUrl};
// TODO: why are the Dao actions not in the dao protos?
use penumbra_proto::{penumbra::core::component::governance::v1alpha1 as pb, DomainType, TypeUrl};

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(try_from = "pb::DaoDeposit", into = "pb::DaoDeposit")]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dao/src/action/dao_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::convert::{TryFrom, TryInto};

use penumbra_asset::{Balance, Value};
use penumbra_keys::Address;
use penumbra_proto::{core::governance::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::governance::v1alpha1 as pb, DomainType, TypeUrl};

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(try_from = "pb::DaoOutput", into = "pb::DaoOutput")]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dao/src/action/dao_spend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use std::convert::{TryFrom, TryInto};

use penumbra_asset::{Balance, Value};
use penumbra_proto::{core::governance::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::governance::v1alpha1 as pb, DomainType, TypeUrl};

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(try_from = "pb::DaoSpend", into = "pb::DaoSpend")]
Expand Down
3 changes: 2 additions & 1 deletion crates/core/component/dex/src/batch_swap_output_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use ark_r1cs_std::{
use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError};
use decaf377::{r1cs::FqVar, Fq};
use penumbra_proto::{
client::v1alpha1::BatchSwapOutputDataResponse, core::dex::v1alpha1 as pb, DomainType, TypeUrl,
client::v1alpha1::BatchSwapOutputDataResponse, penumbra::core::component::dex::v1alpha1 as pb,
DomainType, TypeUrl,
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/lp/action.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};

use penumbra_asset::{balance, Balance, Value};
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};

use super::{position, position::Position, LpNft};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/lp/nft.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use penumbra_asset::asset;
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use regex::Regex;

use super::position::{Id, State};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/lp/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ark_ff::Zero;
use decaf377::Fr;
use decaf377_rdsa::{Signature, SpendAuth};
use penumbra_asset::{balance, Balance, Value};
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_tct as tct;
use rand_core::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 3 additions & 1 deletion crates/core/component/dex/src/lp/position.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use anyhow::{anyhow, Context};
use penumbra_asset::asset;
use penumbra_num::Amount;
use penumbra_proto::{core::dex::v1alpha1 as pb, serializers::bech32str, DomainType, TypeUrl};
use penumbra_proto::{
penumbra::core::component::dex::v1alpha1 as pb, serializers::bech32str, DomainType, TypeUrl,
};
use rand_core::CryptoRngCore;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/lp/reserves.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use penumbra_asset::{Balance, Value};
use penumbra_num::Amount;
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};

use crate::TradingPair;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/lp/trading_function.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{anyhow, Result};
use penumbra_asset::{asset, Value};
use penumbra_num::{fixpoint::U128x128, Amount};
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};
use tracing::instrument;

Expand Down
3 changes: 2 additions & 1 deletion crates/core/component/dex/src/swap/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use decaf377::Fr;
use penumbra_asset::{balance, Balance, Value};
use penumbra_num::Amount;
use penumbra_proto::{
core::crypto::v1alpha1 as pbc, core::dex::v1alpha1 as pb, DomainType, TypeUrl,
core::component::dex::v1alpha1 as pbc, penumbra::core::component::dex::v1alpha1 as pb,
DomainType, TypeUrl,
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap/payload.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::anyhow;
use penumbra_keys::FullViewingKey;
use penumbra_proto::core::dex::v1alpha1 as pb;
use penumbra_proto::penumbra::core::component::dex::v1alpha1 as pb;
use serde::{Deserialize, Serialize};

use super::{SwapCiphertext, SwapPlaintext};
Expand Down
7 changes: 4 additions & 3 deletions crates/core/component/dex/src/swap/plaintext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use decaf377::{FieldExt, Fq};
use once_cell::sync::Lazy;
use penumbra_fee::Fee;
use penumbra_proto::{
core::crypto::v1alpha1 as pb_crypto, core::dex::v1alpha1 as pb, DomainType, TypeUrl,
core::keys::v1alpha1 as pb_keys, penumbra::core::component::dex::v1alpha1 as pb, DomainType,
TypeUrl,
};
use penumbra_tct::StateCommitment;
use poseidon377::{hash_1, hash_4, hash_7};
Expand Down Expand Up @@ -334,7 +335,7 @@ impl From<&SwapPlaintext> for [u8; SWAP_LEN_BYTES] {
bytes[80..96].copy_from_slice(&swap.delta_2_i.to_le_bytes());
bytes[96..112].copy_from_slice(&swap.claim_fee.0.amount.to_le_bytes());
bytes[112..144].copy_from_slice(&swap.claim_fee.0.asset_id.to_bytes());
let pb_address = pb_crypto::Address::from(swap.claim_address);
let pb_address = pb_keys::Address::from(swap.claim_address);
bytes[144..224].copy_from_slice(&pb_address.inner);
bytes[224..256].copy_from_slice(&swap.rseed.to_bytes());
bytes
Expand Down Expand Up @@ -373,7 +374,7 @@ impl TryFrom<&[u8]> for SwapPlaintext {
let address_bytes: [u8; 80] = bytes[144..224]
.try_into()
.map_err(|_| anyhow!("error fetching address bytes"))?;
let pb_address = pb_crypto::Address {
let pb_address = pb_keys::Address {
inner: address_bytes.to_vec(),
alt_bech32m: String::new(),
};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ark_ff::{UniformRand, Zero};
use decaf377::{FieldExt, Fq, Fr};
use penumbra_asset::{balance, Balance, Value};
use penumbra_keys::FullViewingKey;
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use rand_core::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use decaf377::{Fq, Fr};
use decaf377_fmd as fmd;
use decaf377_ka as ka;
use penumbra_fee::Fee;
use penumbra_proto::{core::crypto::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_tct as tct;
use penumbra_tct::r1cs::StateCommitmentVar;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap/view.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use serde::{Deserialize, Serialize};

use super::{Swap, SwapPlaintext};
Expand Down
10 changes: 7 additions & 3 deletions crates/core/component/dex/src/swap_claim/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Context;
use penumbra_asset::Balance;
use penumbra_fee::Fee;
use penumbra_proof_params::GROTH16_PROOF_LENGTH_BYTES;
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_sct::Nullifier;
use penumbra_tct as tct;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -37,7 +37,7 @@ impl DomainType for SwapClaim {
impl From<SwapClaim> for pb::SwapClaim {
fn from(sc: SwapClaim) -> Self {
pb::SwapClaim {
proof: sc.proof.0.into(),
proof: Some(sc.proof.into()),
body: Some(sc.body.into()),
epoch_duration: sc.epoch_duration,
}
Expand All @@ -47,7 +47,11 @@ impl From<SwapClaim> for pb::SwapClaim {
impl TryFrom<pb::SwapClaim> for SwapClaim {
type Error = anyhow::Error;
fn try_from(sc: pb::SwapClaim) -> Result<Self, Self::Error> {
let proof_bytes: [u8; GROTH16_PROOF_LENGTH_BYTES] = (sc.proof[..])
let proof_bytes: [u8; GROTH16_PROOF_LENGTH_BYTES] = sc
.proof
.ok_or_else(|| anyhow::anyhow!("missing swap claim proof"))?
.inner
.as_slice()
.try_into()
.context("swap claim proof malformed")?;
Ok(Self {
Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap_claim/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use penumbra_keys::{
FullViewingKey,
};
use penumbra_proof_params::SWAPCLAIM_PROOF_PROVING_KEY;
use penumbra_proto::{core::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{penumbra::core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_sct::Nullifier;
use penumbra_tct as tct;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/dex/src/swap_claim/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_snark::SNARK;
use decaf377::{r1cs::FqVar, Bls12_377, Fq};
use penumbra_fee::Fee;
use penumbra_proto::{core::crypto::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_proto::{core::component::dex::v1alpha1 as pb, DomainType, TypeUrl};
use penumbra_tct as tct;
use penumbra_tct::r1cs::StateCommitmentVar;

Expand Down
Loading