pub fn create_transaction(
        ctx: Context<CreateTransaction>,
        pid: Pubkey,
        accs: Vec<TransactionAccount>,
        data: Vec<u8>,
    ) -> Result<()> {
        let owner_index = ctx
            .accounts
            .multisig
            .owners
            .iter()
            .position(|a| a == ctx.accounts.proposer.key)
            .ok_or(ErrorCode::InvalidOwner)?;

        let mut signers = Vec::new();
        signers.resize(ctx.accounts.multisig.owners.len(), false);
        signers[owner_index] = true;

        let tx = &mut ctx.accounts.transaction;
        tx.program_id = pid;
        tx.accounts = accs;
        tx.data = data;
        tx.signers = signers;
        tx.multisig = *ctx.accounts.multisig.to_account_info().key;
        tx.did_execute = false;

        Ok(())
    }
// Creates a new transaction account, automatically signed by the creator,
// which must be one of the owners of the multisig.
Creates a new transaction account, automatically signed by the creator,
which must be one of the owners of the multisig.
Creates a new transaction account automatically signed by the creator which must be one of the owners of the multisig .
pub fn create_transaction(
        ctx: Context<CreateTransaction>,
        pid: Pubkey,
        accs: Vec<TransactionAccount>,
        data: Vec<u8>,
    ) -> Result<()> {
        let owner_index = ctx
            .accounts
            .multisig
            .owners
            .iter()
            .position(|a| a == ctx.accounts.proposer.key)
            .ok_or(ErrorCode::InvalidOwner)?;
        let mut signers = Vec::new();
        signers.resize(ctx.accounts.multisig.owners.len(), false);
        signers[owner_index] = true;
        let tx = &mut ctx.accounts.transaction;
        tx.program_id = pid;
        tx.accounts = accs;
        tx.data = data;
        tx.signers = signers;
        tx.multisig = *ctx.accounts.multisig.to_account_info().key;
        tx.did_execute = false;
        Ok(())
    }
pub fn create_transaction ( ctx : Context < CreateTransaction > , pid : Pubkey , accs : Vec < TransactionAccount > , data : Vec < u8 > , ) -> Result < ( ) > { let owner_index = ctx . accounts . multisig . owners . iter ( ) . position ( | a | a == ctx . accounts . proposer . key ) . ok_or ( ErrorCode :: InvalidOwner ) ? ; let mut signers = Vec :: new ( ) ; signers . resize ( ctx . accounts . multisig . owners . len ( ) , false ) ; signers [ owner_index ] = true ; let tx = & mut ctx . accounts . transaction ; tx . program_id = pid ; tx . accounts = accs ; tx . data = data ; tx . signers = signers ; tx . multisig = * ctx . accounts . multisig . to_account_info ( ) . key ; tx . did_execute = false ; Ok ( ( ) ) }
Creates a new transaction account, automatically signed by the creator,
which must be one of the owners of the multisig.
Creates a new transaction account automatically signed by the creator which must be one of the owners of the multisig .
ctx
Context<CreateTransaction>
pid
Pubkey
accs
Vec<TransactionAccount>
data
Vec<u8>
ctx
Context<CreateTransaction>
pid
Pubkey
accs
Vec<TransactionAccount>
data
Vec<u8>