Remove credit-only account handling (#6726)
* Renaming - credit-only/credit-debit to read-only/read-write - debitable to writable * Remove credit handling, making credit-only accounts read-only * Update programs to remove deprecated credit-only account designation * Use readonly and writable instead of underscored types
This commit is contained in:
@@ -55,7 +55,7 @@ pub enum BudgetInstruction {
|
||||
fn initialize_account(contract: &Pubkey, expr: BudgetExpr) -> Instruction {
|
||||
let mut keys = vec![];
|
||||
if let BudgetExpr::Pay(payment) = &expr {
|
||||
keys.push(AccountMeta::new_credit_only(payment.to, false));
|
||||
keys.push(AccountMeta::new(payment.to, false));
|
||||
}
|
||||
keys.push(AccountMeta::new(*contract, false));
|
||||
Instruction::new(
|
||||
@@ -146,7 +146,7 @@ pub fn apply_timestamp(
|
||||
AccountMeta::new(*contract, false),
|
||||
];
|
||||
if from != to {
|
||||
account_metas.push(AccountMeta::new_credit_only(*to, false));
|
||||
account_metas.push(AccountMeta::new(*to, false));
|
||||
}
|
||||
Instruction::new(id(), &BudgetInstruction::ApplyTimestamp(dt), account_metas)
|
||||
}
|
||||
@@ -157,7 +157,7 @@ pub fn apply_signature(from: &Pubkey, contract: &Pubkey, to: &Pubkey) -> Instruc
|
||||
AccountMeta::new(*contract, false),
|
||||
];
|
||||
if from != to {
|
||||
account_metas.push(AccountMeta::new_credit_only(*to, false));
|
||||
account_metas.push(AccountMeta::new(*to, false));
|
||||
}
|
||||
Instruction::new(id(), &BudgetInstruction::ApplySignature, account_metas)
|
||||
}
|
||||
@@ -165,9 +165,9 @@ pub fn apply_signature(from: &Pubkey, contract: &Pubkey, to: &Pubkey) -> Instruc
|
||||
/// Apply account data to a contract waiting on an AccountData witness.
|
||||
pub fn apply_account_data(witness_pubkey: &Pubkey, contract: &Pubkey, to: &Pubkey) -> Instruction {
|
||||
let account_metas = vec![
|
||||
AccountMeta::new_credit_only(*witness_pubkey, false),
|
||||
AccountMeta::new_readonly(*witness_pubkey, false),
|
||||
AccountMeta::new(*contract, false),
|
||||
AccountMeta::new_credit_only(*to, false),
|
||||
AccountMeta::new(*to, false),
|
||||
];
|
||||
Instruction::new(id(), &BudgetInstruction::ApplyAccountData, account_metas)
|
||||
}
|
||||
|
Reference in New Issue
Block a user