1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use borsh::{BorshDeserialize, BorshSerialize};
use core::fmt;
use serde::{Deserialize, Serialize};
#[derive(PartialEq, Eq, Clone, BorshSerialize, BorshDeserialize, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompiledInstruction {
pub program_id_index: u8,
#[serde(with = "short_vec")]
pub accounts: Vec<u8>,
#[serde(with = "short_vec")]
pub data: Vec<u8>,
}
impl fmt::Debug for CompiledInstruction {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("CompiledInstruction")
.field("program_id_index", &self.program_id_index)
.field("accounts", &self.accounts)
.field("data", &blake3::hash(&self.data).to_hex())
.finish()
}
}