50 lines
1.7 KiB
Rust
50 lines
1.7 KiB
Rust
// file: kb-lib/src/executor/fees/bags_fee_share_v1.rs
|
|
// version: 2
|
|
|
|
//! Reserved executor for `fees_bags_fee_share_v1`.
|
|
|
|
/// Reserved executor for the `fees_bags_fee_share_v1` program surface.
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct ExFeesBagsFeeShareV1Executor;
|
|
|
|
impl crate::ExApiInstructionExecutor for crate::ExFeesBagsFeeShareV1Executor {
|
|
fn executor_name(&self) -> &'static str {
|
|
return "kb_executor_fees_bags_fee_share_v1";
|
|
}
|
|
|
|
fn executor_version(&self) -> &'static str {
|
|
return env!("CARGO_PKG_VERSION");
|
|
}
|
|
|
|
fn program_ids(&self) -> &'static [&'static str] {
|
|
return &[kb_program_ids::FEES_BAGS_FEE_SHARE_V1_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":"fees_bags_fee_share_v1"}),
|
|
) {
|
|
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_fees_bags_fee_share_v1".to_string(),
|
|
instruction_count: 0,
|
|
payload_json,
|
|
});
|
|
}
|
|
}
|