Reject TXs when there is a mismatch (#6236)

automerge
This commit is contained in:
Ryo Onodera
2019-10-19 01:48:35 +09:00
committed by Grimes
parent 5468be2ef9
commit 193c9a08e0
3 changed files with 171 additions and 48 deletions

View File

@ -127,6 +127,7 @@ fn get_program_ids(instructions: &[Instruction]) -> Vec<Pubkey> {
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_credit_only_signed_accounts of the signed keys are credit-only accounts.
@ -142,6 +143,7 @@ pub struct MessageHeader {
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
pub struct Message {
/// The message header, identifying signed and credit-only `account_keys`
/// NOTE: Serialization-related changes must be paired with the direct read at sigverify.
pub header: MessageHeader,
/// All the account keys used by this transaction

View File

@ -60,6 +60,7 @@ pub type Result<T> = result::Result<T, TransactionError>;
pub struct Transaction {
/// A set of digital signatures of `account_keys`, `program_ids`, `recent_blockhash`, and `instructions`, signed by the first
/// signatures.len() keys of account_keys
/// NOTE: Serialization-related changes must be paired with the direct read at sigverify.
#[serde(with = "short_vec")]
pub signatures: Vec<Signature>,