|
47 | 47 | //! } |
48 | 48 | //! # |
49 | 49 | //! # use solana_sysvar_id::SysvarId; |
| 50 | +//! # use solana_hash::Hash; |
50 | 51 | //! # let p = EpochRewards::id(); |
51 | 52 | //! # let l = &mut 1559040; |
52 | | -//! # let epoch_rewards = EpochRewards { |
53 | | -//! # distribution_starting_block_height: 42, |
54 | | -//! # total_rewards: 100, |
55 | | -//! # distributed_rewards: 10, |
56 | | -//! # active: true, |
57 | | -//! # ..EpochRewards::default() |
58 | | -//! # }; |
| 53 | +//! # let epoch_rewards = EpochRewards::new(42, 0, Hash::default(), 0, 100, 10, true); |
59 | 54 | //! # let mut d: Vec<u8> = bincode::serialize(&epoch_rewards).unwrap(); |
60 | 55 | //! # let a = AccountInfo::new(&p, false, false, l, &mut d, &p, false); |
61 | 56 | //! # let accounts = &[a.clone(), a]; |
|
95 | 90 | //! } |
96 | 91 | //! # |
97 | 92 | //! # use solana_sysvar_id::SysvarId; |
| 93 | +//! # use solana_hash::Hash; |
98 | 94 | //! # let p = EpochRewards::id(); |
99 | 95 | //! # let l = &mut 1559040; |
100 | | -//! # let epoch_rewards = EpochRewards { |
101 | | -//! # distribution_starting_block_height: 42, |
102 | | -//! # total_rewards: 100, |
103 | | -//! # distributed_rewards: 10, |
104 | | -//! # active: true, |
105 | | -//! # ..EpochRewards::default() |
106 | | -//! # }; |
| 96 | +//! # let epoch_rewards = EpochRewards::new(42, 0, Hash::default(), 0, 100, 10, true); |
107 | 97 | //! # let mut d: Vec<u8> = bincode::serialize(&epoch_rewards).unwrap(); |
108 | 98 | //! # let a = AccountInfo::new(&p, false, false, l, &mut d, &p, false); |
109 | 99 | //! # let accounts = &[a.clone(), a]; |
|
127 | 117 | //! # use anyhow::Result; |
128 | 118 | //! # |
129 | 119 | //! fn print_sysvar_epoch_rewards(client: &RpcClient) -> Result<()> { |
130 | | -//! # let epoch_rewards = EpochRewards { |
131 | | -//! # distribution_starting_block_height: 42, |
132 | | -//! # total_rewards: 100, |
133 | | -//! # distributed_rewards: 10, |
134 | | -//! # active: true, |
135 | | -//! # ..EpochRewards::default() |
136 | | -//! # }; |
| 120 | +//! # use solana_hash::Hash; |
| 121 | +//! # let epoch_rewards = EpochRewards::new(42, 0, Hash::default(), 0, 100, 10, true); |
137 | 122 | //! # let data: Vec<u8> = bincode::serialize(&epoch_rewards)?; |
138 | 123 | //! # client.set_get_account_response(epoch_rewards::ID, Account { |
139 | 124 | //! # lamports: 1120560, |
|
0 commit comments