Skip to main content

compute_private_document_create_from_shielded_pool_fee

Function compute_private_document_create_from_shielded_pool_fee 

Source
pub fn compute_private_document_create_from_shielded_pool_fee(
    num_actions: usize,
    entry_count: usize,
    entry_size: u32,
    platform_version: &PlatformVersion,
) -> Result<Credits, ProtocolError>
Expand description

The fee of a PrivateDocumentCreateFromShieldedPool (protocol version 15): the bundle’s compute_minimum_shielded_fee plus, for each entry, its bytes and the per-entry overhead of fee_version.private_document at the storage rate, and that group’s flat entry fee.

The bundle’s value balance must equal this exactly: there is no recipient to take an excess, and an unusual fee would mark the sender. It depends only on the action count, the entry count and the entry size, so a wallet computes it before building the bundle; the SDK builder, the minimum-fee validation and the transformer all use it.

§Parameters

  • num_actions — number of Orchard actions in the bundle
  • entry_count — number of entries the transition appends
  • entry_size — the bytes each entry takes, the type’s entrySize
  • platform_version — protocol version (determines the formula version and fee constants)