v0.1.0-pre.013
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/bridge.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `bridge` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved bridge materializer.
|
||||
pub use self::core::MtBridgeMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/bridge/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_bridge`.
|
||||
//! Reserved bridge materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_bridge";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for bridge observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtBridgeMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtBridgeMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_bridge";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Bridge,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtBridgeMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_bridge".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/governance.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `governance` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved governance materializer.
|
||||
pub use self::core::MtGovernanceMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/governance/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_governance`.
|
||||
//! Reserved governance materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_governance";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for governance observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtGovernanceMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtGovernanceMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_governance";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Governance,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtGovernanceMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_governance".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/lending.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `lending` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved lending materializer.
|
||||
pub use self::core::MtLendingMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/lending/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_lending`.
|
||||
//! Reserved lending materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_lending";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for lending observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtLendingMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtLendingMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_lending";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Lending,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtLendingMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_lending".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/liquidity.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `liquidity` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved liquidity materializer.
|
||||
pub use self::core::MtLiquidityMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/liquidity/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_liquidity`.
|
||||
//! Reserved liquidity materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_liquidity";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for liquidity observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtLiquidityMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtLiquidityMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_liquidity";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Liquidity,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtLiquidityMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_liquidity".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/nft.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `nft` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved NFT materializer.
|
||||
pub use self::core::MtNftMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/nft/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_nft`.
|
||||
//! Reserved NFT materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_nft";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for NFT observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtNftMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtNftMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_nft";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Nft,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtNftMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_nft".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/oracle.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `oracle` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved oracle materializer.
|
||||
pub use self::core::MtOracleMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/oracle/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_oracle`.
|
||||
//! Reserved oracle materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_oracle";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for oracle observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtOracleMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtOracleMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_oracle";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Oracle,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtOracleMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_oracle".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/orderbook.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `orderbook` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved orderbook materializer.
|
||||
pub use self::core::MtOrderbookMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/orderbook/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_orderbook`.
|
||||
//! Reserved orderbook materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_orderbook";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for orderbook observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtOrderbookMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtOrderbookMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_orderbook";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Orderbook,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtOrderbookMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_orderbook".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/perpetuals.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `perpetuals` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved perpetuals materializer.
|
||||
pub use self::core::MtPerpetualsMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/perpetuals/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_perpetuals`.
|
||||
//! Reserved perpetuals materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_perpetuals";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for perpetuals observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtPerpetualsMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtPerpetualsMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_perpetuals";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Perpetuals,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtPerpetualsMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_perpetuals".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/pool.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `pool` materializer family.
|
||||
|
||||
mod state;
|
||||
|
||||
/// Reserved pool-state materializer.
|
||||
pub use self::state::MtPoolStateMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/pool/state.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_pool_state`.
|
||||
//! Reserved pool-state materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_pool_state";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for pool-state observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtPoolStateMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtPoolStateMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_pool_state";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::PoolState,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtPoolStateMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_pool_state".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/rewards.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `rewards` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved rewards materializer.
|
||||
pub use self::core::MtRewardsMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/rewards/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_rewards`.
|
||||
//! Reserved rewards materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_rewards";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for reward observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtRewardsMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtRewardsMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_rewards";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Reward,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtRewardsMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_rewards".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/routing.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `routing` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved routing materializer.
|
||||
pub use self::core::MtRoutingMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/routing/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_routing`.
|
||||
//! Reserved routing materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_routing";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for routing observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtRoutingMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtRoutingMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_routing";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Routing,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtRoutingMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_routing".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: kb-lib/src/materializer/token.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
//! `token` materializer family.
|
||||
|
||||
@@ -11,6 +11,8 @@ mod metadata_risk;
|
||||
pub use self::accounts::MtTokenAccountsMaterializer;
|
||||
/// Materializes one bounded Token-2022 account state snapshot.
|
||||
pub use self::accounts::materializer_token_materialize_token2022_state_snapshot;
|
||||
/// Reserved token-metadata risk materializer.
|
||||
pub use self::metadata_risk::MtTokenMetadataRiskMaterializer;
|
||||
|
||||
/// Stable processor name for Token, ATA and Token-2022 account projections.
|
||||
pub(crate) use self::constants::MT_TOKEN_ACCOUNTS_PROCESSOR_NAME;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/token/metadata_risk.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_token_metadata_risk`.
|
||||
//! Reserved token-metadata risk materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_token_metadata_risk";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for token-metadata risk observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtTokenMetadataRiskMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtTokenMetadataRiskMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_token_metadata_risk";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::TokenMetadataRisk,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtTokenMetadataRiskMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_token_metadata_risk".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/trades.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `trades` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved trades materializer.
|
||||
pub use self::core::MtTradesMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/trades/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_trades`.
|
||||
//! Reserved trades materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_trades";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for trade observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtTradesMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtTradesMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_trades";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Trade,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtTradesMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_trades".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// file: kb-lib/src/materializer/vault.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! `vault` materializer family.
|
||||
|
||||
mod core;
|
||||
|
||||
/// Reserved vault materializer.
|
||||
pub use self::core::MtVaultMaterializer;
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
// file: kb-lib/src/materializer/vault/core.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_vault`.
|
||||
//! Reserved vault materializer.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
const LEGACY_CRATE: &str = "kb_materializer_vault";
|
||||
/// Current porting status.
|
||||
const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
/// Reserved materializer for vault observations.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MtVaultMaterializer;
|
||||
|
||||
impl crate::MtMaterializer for crate::MtVaultMaterializer {
|
||||
fn materializer_name(&self) -> &'static str {
|
||||
return "kb_materializer_vault";
|
||||
}
|
||||
|
||||
fn materializer_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn accepts_event(&self, _event: &crate::MdDecodedProtocolEvent) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::MdDecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>> {
|
||||
return std::result::Result::Ok(std::vec![crate::MdMaterializedEvent {
|
||||
signature: event.signature.clone(),
|
||||
slot: event.slot,
|
||||
decoded_family: event.event_family,
|
||||
materialized_family: crate::MdMaterializedEventFamily::Vault,
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::MtApiEventMaterializer for crate::MtVaultMaterializer {
|
||||
fn identity(&self) -> crate::MtApiMaterializerIdentity {
|
||||
return crate::MtApiMaterializerIdentity {
|
||||
name: "kb_materializer_vault".to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::MdEventFamily] {
|
||||
return &[];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::MdEventFamily,
|
||||
) -> crate::MtApiMaterializationTransactionPolicy {
|
||||
return crate::MtApiMaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DcApiDecodedObservation,
|
||||
) -> crate::MtApiMaterializerExecutionResult {
|
||||
return crate::MtApiMaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user