Skip to content

Commit 32ccbdf

Browse files
committed
feature: Removed unneeded slot state variable.
1 parent 7896119 commit 32ccbdf

3 files changed

Lines changed: 2 additions & 25 deletions

File tree

packages/client/idl/src/cryptid.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,6 @@ export type Cryptid = {
586586
"option": "publicKey"
587587
}
588588
},
589-
{
590-
"name": "slot",
591-
"docs": [
592-
"The slot in which the transaction was proposed",
593-
"This is used to prevent replay attacks"
594-
],
595-
"type": "u8"
596-
},
597589
{
598590
"name": "state",
599591
"docs": [
@@ -853,7 +845,7 @@ export type Cryptid = {
853845
{
854846
"code": 6017,
855847
"name": "AlreadyAuthorizedTransactionAccount",
856-
"msg": "Already authorized Transaction Account."
848+
"msg": "Transaction Account is already authorized and cannot be authorized again."
857849
}
858850
]
859851
};
@@ -1446,14 +1438,6 @@ export const IDL: Cryptid = {
14461438
"option": "publicKey"
14471439
}
14481440
},
1449-
{
1450-
"name": "slot",
1451-
"docs": [
1452-
"The slot in which the transaction was proposed",
1453-
"This is used to prevent replay attacks"
1454-
],
1455-
"type": "u8"
1456-
},
14571441
{
14581442
"name": "state",
14591443
"docs": [
@@ -1713,7 +1697,7 @@ export const IDL: Cryptid = {
17131697
{
17141698
"code": 6017,
17151699
"name": "AlreadyAuthorizedTransactionAccount",
1716-
"msg": "Already authorized Transaction Account."
1700+
"msg": "Transaction Account is already authorized and cannot be authorized again."
17171701
}
17181702
]
17191703
};

programs/cryptid/src/instructions/propose_transaction.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ pub fn propose_transaction<'info>(
122122
// despite being index 0 in the remaining accounts.
123123
ctx.accounts.transaction_account.accounts = all_accounts.iter().map(|a| *a.key).collect();
124124

125-
// TODO: Set slot OR move any Slot / Expiry constraints to middleware
126-
// ctx.accounts.transaction_account.slot = Clock::get()?.slot;
127125
ctx.accounts.transaction_account.did = *ctx.accounts.did.key;
128126
ctx.accounts.transaction_account.instructions = instructions;
129127
ctx.accounts.transaction_account.cryptid_account = *ctx.accounts.cryptid_account.key;

programs/cryptid/src/state/transaction_account.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ pub struct TransactionAccount {
2020
pub instructions: Vec<AbbreviatedInstructionData>,
2121
/// The most recent middleware PDA that approved the transaction
2222
pub approved_middleware: Option<Pubkey>,
23-
/// The slot in which the transaction was proposed
24-
/// This is used to prevent replay attacks
25-
pub slot: u8,
2623
/// The transaction state, to prevent replay attacks
2724
/// in case an executed transaction account is not immediately
2825
/// garbage-collected by the runtime
@@ -46,7 +43,6 @@ impl TransactionAccount {
4643
+ 4 + 32 * (num_accounts + 4) //accounts (+4 for the named accounts)
4744
+ 4 + instruction_sizes.into_iter().map(AbbreviatedInstructionData::calculate_size).sum::<usize>() //transaction_instructions
4845
+ 1 + 32 // approved_middleware
49-
+ 1 // slot
5046
+ 1 // state
5147
+ 1 + 32 // unauthorized signer
5248
+ 1 // authorized
@@ -104,7 +100,6 @@ mod test {
104100
data: vec![0],
105101
}],
106102
approved_middleware: None,
107-
slot: 0,
108103
state: TransactionState::Ready,
109104
unauthorized_signer: None,
110105
authorized: true,

0 commit comments

Comments
 (0)