pub struct MultisigLayout {
pub fee_payer: TnPubkey,
pub program: TnPubkey,
pub rw: Vec<TnPubkey>,
pub ro: Vec<TnPubkey>,
}Expand description
The account list of a multisig program transaction: fee payer at 0, the multisig program at 1, then read-write accounts sorted, then read-only accounts sorted.
Fields§
§fee_payer: TnPubkey§program: TnPubkey§rw: Vec<TnPubkey>§ro: Vec<TnPubkey>Implementations§
Source§impl MultisigLayout
impl MultisigLayout
Sourcepub fn new(
fee_payer: TnPubkey,
program: TnPubkey,
rw: &[TnPubkey],
ro: &[TnPubkey],
) -> Self
pub fn new( fee_payer: TnPubkey, program: TnPubkey, rw: &[TnPubkey], ro: &[TnPubkey], ) -> Self
Builds a layout. Duplicates are merged (read-write wins), and the fee payer and program are dropped from the lists since they have fixed slots.
pub fn index_of(&self, key: &TnPubkey) -> Option<u16>
pub fn idx(&self, key: &TnPubkey) -> Result<u16>
pub fn is_writable(&self, key: &TnPubkey) -> bool
Sourcepub fn apply(&self, tx: Transaction) -> Transaction
pub fn apply(&self, tx: Transaction) -> Transaction
Adds the layout’s accounts to a transaction built with
Transaction::new(fee_payer, program, ..).
Sourcepub fn for_request(
fee_payer: TnPubkey,
program: TnPubkey,
multisig: TnPubkey,
request: TnPubkey,
child_rw: &[TnPubkey],
child_ro: &[TnPubkey],
) -> Self
pub fn for_request( fee_payer: TnPubkey, program: TnPubkey, multisig: TnPubkey, request: TnPubkey, child_rw: &[TnPubkey], child_ro: &[TnPubkey], ) -> Self
The layout CREATE_REQUEST and EXECUTE_REQUEST share: the multisig
and request accounts are read-write, plus the child call’s accounts.
Sourcepub fn from_request(
executor: TnPubkey,
program: TnPubkey,
multisig: TnPubkey,
request: TnPubkey,
req: &RequestAccount,
) -> Result<Self>
pub fn from_request( executor: TnPubkey, program: TnPubkey, multisig: TnPubkey, request: TnPubkey, req: &RequestAccount, ) -> Result<Self>
Rebuilds the execute-time layout from a stored request. Stored
(index, pubkey) pairs pin each referenced account’s position. The
request does not record which accounts were writable, so the
read-write/read-only split must be the only one that satisfies every
stored index; an ambiguous request is refused rather than guessed.
propose only submits requests that reproduces accepts.
pub fn from_payload( executor: TnPubkey, program: TnPubkey, multisig: TnPubkey, request: TnPubkey, payload: &RequestPayload, ) -> Result<Self>
Sourcepub fn reproduces(
&self,
multisig: TnPubkey,
request: TnPubkey,
payload: &RequestPayload,
) -> bool
pub fn reproduces( &self, multisig: TnPubkey, request: TnPubkey, payload: &RequestPayload, ) -> bool
True if executing payload (from any other fee payer) rebuilds
exactly this layout’s writable and read-only accounts.