solana_workflow/
lib.rs

1use anchor_lang::prelude::*;
2use instructions::*;
3
4pub mod instructions;
5pub mod pda;
6
7declare_id!("GfV9B4DHq93LCWjD3nSmFgStH7BxrDka8v7fgH7u1SCV");
8
9#[program]
10pub mod solana_workflow {
11    use super::*;
12
13    pub fn create_workflow<'c: 'info, 'info>(
14        ctx: Context<'_, '_, 'c, 'info, CreateWorkflow<'info>>,
15        title: String,
16        start: u16,
17        workflow_id: u64,
18        input_checkpoints: Vec<InputCheckPoint>,
19    ) -> Result<()> {
20        instructions::create_workflow::create_workflow(
21            ctx,
22            title,
23            start,
24            workflow_id,
25            input_checkpoints,
26        )
27    }
28
29    pub fn create_mission(
30        ctx: Context<CreateMission>,
31        workflow_id: u64,
32        mission_id: u64,
33        title: String,
34        content: String,
35        current_vote_data: Pubkey,
36        checkpoint_id: u16,
37        vote_data_id: u64,
38    ) -> Result<()> {
39        instructions::create_mission::create_mission(
40            ctx,
41            workflow_id,
42            mission_id,
43            title,
44            content,
45            current_vote_data,
46            checkpoint_id,
47            vote_data_id,
48        )
49    }
50
51    pub fn move_next_checkpoint(ctx: Context<MoveNextCheckpoint>, vote_data_id: u16) -> Result<()> {
52        instructions::move_next_checkpoint::move_next_checkpoint(ctx, vote_data_id)
53    }
54
55    pub fn change_variable(
56        ctx: Context<CreateVariable>,
57        value: Vec<u8>,
58        variable_id: u8,
59    ) -> Result<()> {
60        instructions::change_variable::change_variable(ctx, value, variable_id)
61    }
62}