Created
September 20, 2018 17:16
-
-
Save aeyakovenko/3a1596f71f1975f2aec1963801f41ab3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] | |
struct Program { | |
/// program_id maps to an entry point | |
program_id: Pubkey, | |
/// These indecies point to Transaction::keys array and accounts for those keys will be loaded | |
/// for execution | |
keys: Vec<u8>, | |
/// Userdata to pass along each call | |
userdata: Vec<u8>, | |
} | |
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] | |
pub struct Transaction { | |
/// A digital signature of `keys`, `program_id`, `last_id`, `fee` and `userdata`, signed by `Pubkey`. | |
pub signature: Signature, | |
/// The `Pubkeys` that are executing this transaction userdata. The meaning of each key is | |
/// program-specific. | |
/// * keys[0] - Typically this is the `caller` public key. `signature` is verified with keys[0]. | |
/// In the future which key pays the fee and which keys have signatures would be configurable. | |
/// * keys[1] - Typically this is the program context or the recipient of the tokens | |
pub keys: Vec<Pubkey>, | |
/// The ID of a recent ledger entry. | |
pub last_id: Hash, | |
/// The number of tokens paid for processing and storage of this transaction. | |
pub fee: i64, | |
/// Execute the programs atomically | |
pub programs: Vec<Program> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍 , with this too: