Skip to content

Commit

Permalink
Merge pull request #995 from anoma/tiago/ethbridge/misc-fixes
Browse files Browse the repository at this point in the history
Fix `cargo doc` and the makefile
  • Loading branch information
sug0 authored Jan 11, 2023
2 parents 87adc5f + aa129b5 commit 1361088
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build-release:
NAMADA_DEV=false $(cargo) build --release --package namada_apps --manifest-path Cargo.toml

build-debug:
ANOMA_DEV=false $(cargo) build --package namada_apps --manifest-path Cargo.toml
NAMADA_DEV=false $(cargo) build --package namada_apps --manifest-path Cargo.toml

install-release:
NAMADA_DEV=false $(cargo) install --path ./apps --locked
Expand Down
24 changes: 13 additions & 11 deletions apps/src/lib/node/ledger/shell/block_space_alloc/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ mod protocol_txs;
mod remaining_txs;

use super::{AllocFailure, BlockSpaceAllocator};
#[allow(unused_imports)]
use crate::node::ledger::shell::block_space_alloc;

/// Convenience wrapper for a [`BlockSpaceAllocator`] state that allocates
/// encrypted transactions.
Expand All @@ -44,21 +46,21 @@ pub enum EncryptedTxBatchAllocator {
/// a new batch of DKG decrypted transactions.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub enum BuildingDecryptedTxBatch {}

/// The leader of the current Tendermint round is building
/// a new batch of Namada protocol transactions.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub enum BuildingProtocolTxBatch {}

/// The leader of the current Tendermint round is building
/// a new batch of DKG encrypted transactions.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub struct BuildingEncryptedTxBatch<Mode> {
/// One of [`WithEncryptedTxs`] and [`WithoutEncryptedTxs`].
_mode: Mode,
Expand All @@ -70,25 +72,25 @@ pub struct BuildingEncryptedTxBatch<Mode> {
/// block, yet.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub enum FillingRemainingSpace {}

/// Allow block proposals to include encrypted txs.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub enum WithEncryptedTxs {}

/// Prohibit block proposals from including encrypted txs.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub enum WithoutEncryptedTxs {}

/// Try to allocate a new transaction on a [`BlockSpaceAllocator`] state.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub trait TryAlloc {
/// Try to allocate space for a new transaction.
fn try_alloc(&mut self, tx: &[u8]) -> Result<(), AllocFailure>;
Expand All @@ -101,7 +103,7 @@ pub trait TryAlloc {
/// [`NextStateWithoutEncryptedTxs`].
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub trait NextStateImpl<Transition = ()> {
/// The next state in the [`BlockSpaceAllocator`] state machine.
type Next;
Expand All @@ -115,7 +117,7 @@ pub trait NextStateImpl<Transition = ()> {
/// state with encrypted txs in a block.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub trait NextStateWithEncryptedTxs: NextStateImpl<WithEncryptedTxs> {
/// Transition to the next state in the [`BlockSpaceAllocator`] state,
/// ensuring we include encrypted txs in a block.
Expand All @@ -134,7 +136,7 @@ impl<S> NextStateWithEncryptedTxs for S where S: NextStateImpl<WithEncryptedTxs>
/// state without encrypted txs in a block.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub trait NextStateWithoutEncryptedTxs:
NextStateImpl<WithoutEncryptedTxs>
{
Expand All @@ -158,7 +160,7 @@ impl<S> NextStateWithoutEncryptedTxs for S where
/// state with a null transition function.
///
/// For more info, read the module docs of
/// [`crate::node::ledger::shell::prepare_proposal::block_space_alloc::states`].
/// [`block_space_alloc::states`].
pub trait NextState: NextStateImpl {
/// Transition to the next state in the [`BlockSpaceAllocator`] state,
/// using a null transiiton function.
Expand Down
2 changes: 2 additions & 0 deletions apps/src/lib/node/ledger/shell/prepare_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use super::block_space_alloc::{AllocFailure, BlockSpaceAllocator};
#[cfg(feature = "abcipp")]
use crate::facade::tendermint_proto::abci::ExtendedCommitInfo;
use crate::facade::tendermint_proto::abci::RequestPrepareProposal;
#[allow(unused_imports)]
use crate::node::ledger::shell::block_space_alloc;
#[cfg(not(feature = "abcipp"))]
use crate::node::ledger::shell::vote_extensions::deserialize_vote_extensions;
#[cfg(feature = "abcipp")]
Expand Down
3 changes: 1 addition & 2 deletions apps/src/lib/node/ledger/shell/vote_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ pub fn deserialize_vote_extensions(
}

/// Given a slice of [`TxBytes`], return an iterator over the
/// ones we could deserialize to vote extension [`ProtocolTx`]
/// instances.
/// ones we could deserialize to vote extension protocol txs.
#[cfg(not(feature = "abcipp"))]
pub fn deserialize_vote_extensions<'shell>(
txs: &'shell [TxBytes],
Expand Down
2 changes: 1 addition & 1 deletion core/src/ledger/eth_bridge/storage/bridge_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl BridgePoolTree {
/// bridge pool.
///
/// It should have one string segment which should
/// parse into a [Hash]
/// parse into a [`struct@Hash`].
fn parse_key(key: &Key) -> Result<KeccakHash, Error> {
if key.segments.len() == 1 {
match &key.segments[0] {
Expand Down

0 comments on commit 1361088

Please sign in to comment.