v0.1.0-pre.019

This commit is contained in:
2026-07-24 20:14:28 +02:00
parent f965fcc58a
commit fa2d9d8ecd
10 changed files with 703 additions and 142 deletions

View File

@@ -1,49 +1,27 @@
// file: kb-lib/src/executor/spl/elgamal_registry.rs
// version: 2
// version: 3
//! Reserved executor for `spl_elgamal_registry`.
//! Typed executor for the SPL ElGamal public-key registry.
/// Reserved executor for the `spl_elgamal_registry` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExSplElgamalRegistryExecutor;
mod builder;
mod constants;
mod executor;
mod intent;
impl crate::ExApiInstructionExecutor for crate::ExSplElgamalRegistryExecutor {
fn executor_name(&self) -> &'static str {
return "kb_executor_spl_elgamal_registry";
}
/// Exposes the typed ElGamal registry executor.
pub use self::executor::ExSplElgamalRegistryExecutor;
/// Stable operation code for registry creation.
pub use self::intent::EX_SPL_ELGAMAL_REGISTRY_CREATE_OPERATION;
/// Stable operation code for registry update.
pub use self::intent::EX_SPL_ELGAMAL_REGISTRY_UPDATE_OPERATION;
/// Exposes the complete typed execution intent.
pub use self::intent::ExSplElgamalRegistryExecutionIntent;
/// Exposes one exact registry operation.
pub use self::intent::ExSplElgamalRegistryOperation;
/// Exposes the proof-location contract.
pub use self::intent::ExSplElgamalRegistryProofLocation;
fn executor_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::SPL_TOKEN2022_ELGAMAL_REGISTRY_PROGRAM_ID];
}
fn supports_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"spl_elgamal_registry"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb_executor_spl_elgamal_registry".to_string(),
instruction_count: 0,
payload_json,
});
}
}
/// Crate-root access to the exact ElGamal registry plan builder.
pub(crate) use self::builder::executor_spl_elgamal_registry_build_prepared_plan;
/// Canonical tracing target for the SPL ElGamal registry executor.
pub(crate) use self::constants::EX_SPL_ELGAMAL_REGISTRY_TRACING_TARGET;