Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Apr 15, 2024
1 parent 79b3da0 commit 2c1a280
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 7 additions & 6 deletions sdk/program/src/message/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,11 @@ impl Message {
}

/// Returns true if the account at the specified index is writable by the
/// instructions in this message. Since the dynamic set of reserved accounts
/// isn't used here to demote write locks, this shouldn't be used in the
/// runtime.
/// instructions in this message. The `reserved_account_keys` param has been
/// optional to allow clients to approximate writability without requiring
/// fetching the latest set of reserved account keys. If this method is
/// called by the runtime, the latest set of reserved account keys must be
/// passed.
pub fn is_maybe_writable(
&self,
i: usize,
Expand All @@ -589,9 +591,8 @@ impl Message {
&& !self.demote_program_id(i)
}

/// Returns true if the account at the specified index is in the reserved
/// account keys set. Before loading addresses, we can't detect reserved
/// account keys properly so this shouldn't be used by the runtime.
/// Returns true if the account at the specified index is in the optional
/// reserved account keys set.
fn is_account_maybe_reserved(
&self,
key_index: usize,
Expand Down
4 changes: 3 additions & 1 deletion sdk/program/src/message/versions/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ impl Message {

/// Returns true if the account at the specified index was requested as
/// writable. Before loading addresses, we can't demote write locks properly
/// so this should not be used by the runtime.
/// so this should not be used by the runtime. The `reserved_account_keys`
/// param is optional to allow clients to approximate writability without
/// requiring fetching the latest set of reserved account keys.
pub fn is_maybe_writable(
&self,
key_index: usize,
Expand Down

0 comments on commit 2c1a280

Please sign in to comment.