jormungandr-lib: document fragment rejection information
@@ -3,6 +3,9 @@ use chain_impl_mockchain::fragment::FragmentId;
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, DisplayFromStr};
+/// This error is reserved for fragments that were rejected by the mempool at the time of sending
+/// them to mempool. If a fragment ended up being included to mempool, it will be listed in
+/// fragment logs and all further errors would be listed in fragment logs as well.
#[derive(Debug, Serialize, Deserialize)]
pub enum FragmentRejectionReason {
FragmentAlreadyInLog,
@@ -11,6 +14,8 @@ pub enum FragmentRejectionReason {
PoolOverflow { pool_number: usize },
}
+/// Information about a fragment rejected by the mempool. This is different from being rejected by
+/// the ledger during an attempt to apply this fragment.
#[serde_as]
#[derive(Debug, Serialize, Deserialize)]
pub struct RejectedFragmentInfo {
@@ -19,6 +24,7 @@ pub struct RejectedFragmentInfo {
pub reason: FragmentRejectionReason,
}
+/// The summary of an attempt to add transactions to mempool for further processing.
#[serde_as]
#[derive(Debug, Serialize, Deserialize)]
pub struct FragmentsProcessingSummary {
