0.5.1-pre.002
This commit is contained in:
49
ks-lib/src/executor/amm/aldrin_v2.rs
Normal file
49
ks-lib/src/executor/amm/aldrin_v2.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/amm/aldrin_v2.rs
|
||||
// version: 4
|
||||
|
||||
//! Reserved executor for `amm_aldrin_v2`.
|
||||
|
||||
/// Reserved executor for the `amm_aldrin_v2` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExAmmAldrinV2Executor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExAmmAldrinV2Executor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.amm.aldrin_v2";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::AMM_ALDRIN_V2_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,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"amm_aldrin_v2"}),
|
||||
) {
|
||||
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-lib.executor.amm.aldrin_v2".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user