Skip to content

Commit 3ab3517

Browse files
committed
require signer on Initialize
1 parent b2a1301 commit 3ab3517

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

interface/src/instruction.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub enum NonceInstruction {
1717
/// 3. Writes `NonceState { nonce, authority }` into the account data.
1818
///
1919
/// Accounts required:
20+
/// - `[signer]` Authority whose address derives the nonce account
2021
/// - `[writable]` `NonceStatePda`, pre-funded
21-
/// - `[]` `SlotHashes` sysvar
2222
/// - `[]` System program
2323
Initialize,
2424

@@ -60,23 +60,6 @@ pub enum NonceInstruction {
6060
Close,
6161
}
6262

63-
/// Data for [`NonceInstruction::Initialize`].
64-
#[derive(Clone, Debug, PartialEq, Eq, SchemaRead, SchemaWrite)]
65-
pub struct InitializeData {
66-
/// Caller-chosen identifier for this nonce account. Each distinct value derives its own
67-
/// [`NonceStatePda`](crate::pda::NonceStatePda).
68-
pub nonce_id: [u8; 32],
69-
/// Authorizes `Submit` ix for this account.
70-
pub authority: Address,
71-
}
72-
73-
/// Data for [`NonceInstruction::SetAuthority`].
74-
#[derive(Clone, Debug, PartialEq, Eq, SchemaRead, SchemaWrite)]
75-
pub struct SetAuthorityData {
76-
/// Replacement authority address.
77-
pub authority: Address,
78-
}
79-
8063
/// Data for [`NonceInstruction::Close`].
8164
#[derive(Clone, Debug, PartialEq, Eq, SchemaRead, SchemaWrite)]
8265
pub struct CloseData {

interface/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use {
88
#[derive(Clone, Debug, PartialEq, Eq, SchemaRead, SchemaWrite)]
99
pub struct NonceState {
1010
/// Single-use value that prevents a signed message from being replayed. `Submit` requires
11-
/// the wrapped v1 transaction message's lifetime specifier to equal this. On success,
11+
/// the wrapped `v1` transaction message's lifetime specifier to equal this. On success,
1212
/// `Submit` advances it to a fresh hash over the prior nonce, `SlotHashes[0]`, and the
1313
/// wrapped message bytes.
1414
pub nonce: Hash,

0 commit comments

Comments
 (0)