v0.1.0-pre.011-fix-01

This commit is contained in:
2026-07-24 15:06:27 +02:00
parent 42e8a203ec
commit 60660ca555
161 changed files with 10665 additions and 977 deletions

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/fees/core.rs
// version: 2
// version: 3
//! Stable fee projections derived from exact committed Token-2022 observations.
@@ -151,7 +151,7 @@ fn contains(entries: &[&str], entry_code: &str) -> bool {
}
/// Materialize authoritative Token-2022 fee extension snapshots without decrypting confidential values.
pub fn materialize_token2022_fee_state_snapshots(
pub fn materializer_fees_materialize_token2022_state_snapshots(
account_key: &str,
slot: u64,
state: &crate::DcToken2022State,
@@ -371,8 +371,10 @@ mod tests {
value_fields: serde_json::json!({"withheldAmount":"7"}),
}],
};
let first = crate::materialize_token2022_fee_state_snapshots("mint111", 42, &mint);
let second = crate::materialize_token2022_fee_state_snapshots("mint111", 42, &mint);
let first =
crate::materializer_fees_materialize_token2022_state_snapshots("mint111", 42, &mint);
let second =
crate::materializer_fees_materialize_token2022_state_snapshots("mint111", 42, &mint);
assert!(first.is_ok());
assert_eq!(first, second);
let outputs = match first {
@@ -399,7 +401,11 @@ mod tests {
value_fields: serde_json::json!({"withheldAmount":"ciphertext"}),
}],
};
let result = crate::materialize_token2022_fee_state_snapshots("account111", 43, &account);
let result = crate::materializer_fees_materialize_token2022_state_snapshots(
"account111",
43,
&account,
);
assert!(result.is_ok());
let outputs = match result {
std::result::Result::Ok(outputs) => outputs,
@@ -425,8 +431,16 @@ mod tests {
}],
};
assert!(
crate::materialize_token2022_fee_state_snapshots("account111", 44, &wrong,).is_err()
crate::materializer_fees_materialize_token2022_state_snapshots(
"account111",
44,
&wrong,
)
.is_err()
);
assert!(
crate::materializer_fees_materialize_token2022_state_snapshots("", 44, &wrong,)
.is_err()
);
assert!(crate::materialize_token2022_fee_state_snapshots("", 44, &wrong,).is_err());
}
}