-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version transaction message and add new message format
- Loading branch information
Showing
4 changed files
with
675 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! A library for generating a message from a sequence of instructions | ||
mod original; | ||
mod v0; | ||
mod versions; | ||
|
||
pub use original::Message; | ||
|
||
pub const MESSAGE_HEADER_LENGTH: usize = 3; | ||
|
||
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq, Clone, AbiExample)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct MessageHeader { | ||
/// The number of signatures required for this message to be considered valid. The | ||
/// signatures must match the first `num_required_signatures` of `account_keys`. | ||
/// NOTE: Serialization-related changes must be paired with the direct read at sigverify. | ||
pub num_required_signatures: u8, | ||
|
||
/// The last num_readonly_signed_accounts of the signed keys are read-only accounts. Programs | ||
/// may process multiple transactions that load read-only accounts within a single PoH entry, | ||
/// but are not permitted to credit or debit lamports or modify account data. Transactions | ||
/// targeting the same read-write account are evaluated sequentially. | ||
pub num_readonly_signed_accounts: u8, | ||
|
||
/// The last num_readonly_unsigned_accounts of the unsigned keys are read-only accounts. | ||
pub num_readonly_unsigned_accounts: u8, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.