use crate::{
consensus::{self, BlockHeight},
transaction::components::{amount::Amount, transparent::fees as transparent},
};
#[cfg(feature = "zfuture")]
use crate::transaction::components::tze::fees as tze;
pub mod fixed;
pub mod zip317;
pub trait FeeRule {
type Error;
fn fee_required<P: consensus::Parameters>(
&self,
params: &P,
target_height: BlockHeight,
transparent_inputs: &[impl transparent::InputView],
transparent_outputs: &[impl transparent::OutputView],
sapling_input_count: usize,
sapling_output_count: usize,
) -> Result<Amount, Self::Error>;
}
#[cfg(feature = "zfuture")]
pub trait FutureFeeRule: FeeRule {
#[allow(clippy::too_many_arguments)]
fn fee_required_zfuture<P: consensus::Parameters>(
&self,
params: &P,
target_height: BlockHeight,
transparent_inputs: &[impl transparent::InputView],
transparent_outputs: &[impl transparent::OutputView],
sapling_input_count: usize,
sapling_output_count: usize,
tze_inputs: &[impl tze::InputView],
tze_outputs: &[impl tze::OutputView],
) -> Result<Amount, Self::Error>;
}