|
1 |
| -#[cfg(RUSTC_WITH_SPECIALIZATION)] |
2 |
| -use solana_frozen_abi::abi_example::AbiExample; |
3 | 1 | use {
|
4 | 2 | itertools::Itertools,
|
5 | 3 | serde::ser::{Serialize, Serializer},
|
@@ -30,15 +28,15 @@ pub enum Error {
|
30 | 28 | InvalidOwner(/*owner:*/ Pubkey),
|
31 | 29 | }
|
32 | 30 |
|
33 |
| -#[derive(Debug)] |
| 31 | +#[derive(Debug, AbiExample)] |
34 | 32 | struct VoteAccountInner {
|
35 | 33 | account: AccountSharedData,
|
36 | 34 | vote_state: OnceLock<Result<VoteState, Error>>,
|
37 | 35 | }
|
38 | 36 |
|
39 | 37 | pub type VoteAccountsHashMap = HashMap<Pubkey, (/*stake:*/ u64, VoteAccount)>;
|
40 | 38 |
|
41 |
| -#[derive(Clone, Debug, Deserialize)] |
| 39 | +#[derive(Clone, Debug, Deserialize, AbiExample)] |
42 | 40 | #[serde(from = "Arc<VoteAccountsHashMap>")]
|
43 | 41 | pub struct VoteAccounts {
|
44 | 42 | vote_accounts: Arc<VoteAccountsHashMap>,
|
@@ -321,26 +319,6 @@ impl Serialize for VoteAccounts {
|
321 | 319 | }
|
322 | 320 | }
|
323 | 321 |
|
324 |
| -#[cfg(RUSTC_WITH_SPECIALIZATION)] |
325 |
| -impl AbiExample for VoteAccountInner { |
326 |
| - fn example() -> Self { |
327 |
| - Self { |
328 |
| - account: AccountSharedData::example(), |
329 |
| - vote_state: OnceLock::from(Result::<VoteState, Error>::example()), |
330 |
| - } |
331 |
| - } |
332 |
| -} |
333 |
| - |
334 |
| -#[cfg(RUSTC_WITH_SPECIALIZATION)] |
335 |
| -impl AbiExample for VoteAccounts { |
336 |
| - fn example() -> Self { |
337 |
| - Self { |
338 |
| - vote_accounts: Arc::<VoteAccountsHashMap>::example(), |
339 |
| - staked_nodes: OnceLock::from(Arc::<HashMap<Pubkey, u64>>::example()), |
340 |
| - } |
341 |
| - } |
342 |
| -} |
343 |
| - |
344 | 322 | #[cfg(test)]
|
345 | 323 | mod tests {
|
346 | 324 | use {
|
|
0 commit comments