Skip to content

Commit

Permalink
pass compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Jan 31, 2025
1 parent cedfc5f commit f056300
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions crates/core/app/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ pub trait StateReadExt: StateRead {
let distributions_params = self.get_distributions_params().await?;
let ibc_params = self.get_ibc_params().await?;
let fee_params = self.get_fee_params().await?;
let funding_params = self.get_funding_params().await?;
let funding_params = self.get_staking_funding_params().await?;
let governance_params = self.get_governance_params().await?;
let sct_params = self.get_sct_params().await?;
let shielded_pool_params = self.get_shielded_pool_params().await?;
Expand Down Expand Up @@ -812,7 +812,7 @@ pub trait StateWriteExt: StateWrite {
self.put_community_pool_params(community_pool_params);
self.put_distributions_params(distributions_params);
self.put_fee_params(fee_params);
self.put_funding_params(funding_params);
self.put_staking_funding_params(funding_params);
self.put_governance_params(governance_params);
self.put_ibc_params(ibc_params);
self.put_sct_params(sct_params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use cnidarium::{StateRead, StateWrite};
use penumbra_sdk_proto::{StateReadProto, StateWriteProto};
use penumbra_sdk_sct::{component::clock::EpochRead, Nullifier};

#[allow(dead_code)]
#[async_trait]
pub trait NullifierRead: StateRead {
/// Gets the transaction id associated with the given nullifier from the JMT.
Expand All @@ -17,10 +18,8 @@ pub trait NullifierRead: StateRead {
.expect("epoch is always set")
.index;

let nullifier_key = &state_key::lqt::v1::nf::by_epoch::lqt_nullifier_lookup_for_txid(
epoch_index,
&nullifier,
);
let nullifier_key =
&state_key::lqt::v1::nullifier::lqt_nullifier_lookup_for_txid(epoch_index, &nullifier);

let tx_id: Option<TransactionId> = self
.nonverifiable_get(&nullifier_key.as_bytes())
Expand All @@ -33,14 +32,13 @@ pub trait NullifierRead: StateRead {

impl<T: StateRead + ?Sized> NullifierRead for T {}

#[allow(dead_code)]
#[async_trait]
pub trait NullifierWrite: StateWrite {
/// Sets the LQT nullifier in the JMT.
fn put_lqt_nullifier(&mut self, epoch_index: u64, nullifier: Nullifier, tx_id: TransactionId) {
let nullifier_key = state_key::lqt::v1::nf::by_epoch::lqt_nullifier_lookup_for_txid(
epoch_index,
&nullifier,
);
let nullifier_key =
state_key::lqt::v1::nullifier::lqt_nullifier_lookup_for_txid(epoch_index, &nullifier);

self.put(nullifier_key, tx_id);
}
Expand Down
16 changes: 7 additions & 9 deletions crates/core/component/funding/src/component/state_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ pub fn staking_funding_parameters() -> &'static str {

pub mod lqt {
pub mod v1 {
pub mod nf {
pub mod by_epoch {
use penumbra_sdk_sct::Nullifier;
pub mod nullifier {
use penumbra_sdk_sct::Nullifier;

pub(crate) fn lqt_nullifier_lookup_for_txid(
epoch_index: u64,
nullifier: &Nullifier,
) -> String {
format!("funding/lqt/v1/nf/by_epoch/{epoch_index:020}/lookup/{nullifier}")
}
pub(crate) fn lqt_nullifier_lookup_for_txid(
epoch_index: u64,
nullifier: &Nullifier,
) -> String {
format!("funding/lqt/v1/nullifier/{epoch_index:020}/lookup/{nullifier}")
}
}
}
Expand Down

0 comments on commit f056300

Please sign in to comment.