fn new_instruction_refdb_write(
        &self,
        admin_address: &Pubkey,
        refdb_name: &str,
        record: refdb::Record,
    ) -> Result<Instruction, FarmClientError> {
        // fill in accounts and instruction data
        let mut inst = Instruction {
            program_id: main_router::id(),
            data: Vec::<u8>::new(),
            accounts: vec![
                AccountMeta::new_readonly(*admin_address, true),
                AccountMeta::new(find_refdb_pda(refdb_name).0, false),
                AccountMeta::new_readonly(system_program::id(), false),
            ],
        };

        inst.data = MainInstruction::RefDbInstruction {
            instruction: RefDbInstruction::Write { record },
        }
        .to_vec()?;

        Ok(inst)
    }
/// Creates a new instruction for writing the record into on-chain RefDB
Creates a new instruction for writing the record into on-chain RefDB
Creates a new instruction for writing the record into on - chain RefDB
fn new_instruction_refdb_write(
        &self,
        admin_address: &Pubkey,
        refdb_name: &str,
        record: refdb::Record,
    ) -> Result<Instruction, FarmClientError> {
        // fill in accounts and instruction data
        let mut inst = Instruction {
            program_id: main_router::id(),
            data: Vec::<u8>::new(),
            accounts: vec![
                AccountMeta::new_readonly(*admin_address, true),
                AccountMeta::new(find_refdb_pda(refdb_name).0, false),
                AccountMeta::new_readonly(system_program::id(), false),
            ],
        };
        inst.data = MainInstruction::RefDbInstruction {
            instruction: RefDbInstruction::Write { record },
        }
        .to_vec()?;
        Ok(inst)
    }
fn new_instruction_refdb_write ( & self , admin_address : & Pubkey , refdb_name : & str , record : refdb :: Record , ) -> Result < Instruction , FarmClientError > { // fill in accounts and instruction data let mut inst = Instruction { program_id : main_router :: id ( ) , data : Vec :: < u8 > :: new ( ) , accounts : vec ! [ AccountMeta new_readonly ( admin_address true ) AccountMeta new ( find_refdb_pda ( refdb_name ) 0 false ) AccountMeta new_readonly ( system_program id ( ) false ) ] , } ; inst . data = MainInstruction :: RefDbInstruction { instruction : RefDbInstruction :: Write { record } , } . to_vec ( ) ? ; Ok ( inst ) }
Creates a new instruction for writing the record into on-chain RefDB
Creates a new instruction for writing the record into on - chain RefDB
&self
admin_address
&Pubkey
refdb_name
&str
record
refdb::Record
&self
admin_address
&Pubkey
refdb_name
&str
record
refdb::Record