Skip to content

Commit 853a4af

Browse files
committed
handle linting errors; idl build traits
1 parent 0d281ec commit 853a4af

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

programs/validator-history/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.co
3333
semver = "1.0.17"
3434
serde = "1.0.183"
3535
serde_derive = "1.0.183"
36-
solana-security-txt = "1.1.0"
3736
solana-program = "1.18"
37+
solana-security-txt = "1.1.0"
3838
static_assertions = "1.1.0"
3939
thiserror = "1.0.37"
4040
type-layout = "0.2"

programs/validator-history/src/state.rs

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#[cfg(feature = "idl-build")]
2+
use anchor_lang::idl::{
3+
types::{IdlEnumVariant, IdlTypeDef, IdlTypeDefTy},
4+
IdlBuild,
5+
};
6+
17
use {
28
crate::{
39
constants::TVC_MULTIPLIER,
@@ -70,6 +76,39 @@ impl MerkleRootUploadAuthority {
7076
}
7177
}
7278

79+
#[cfg(feature = "idl-build")]
80+
impl IdlBuild for MerkleRootUploadAuthority {
81+
fn create_type() -> Option<IdlTypeDef> {
82+
Some(IdlTypeDef {
83+
name: "MerkleRootUploadAuthority".to_string(),
84+
ty: IdlTypeDefTy::Enum {
85+
variants: vec![
86+
IdlEnumVariant {
87+
name: "Empty".to_string(),
88+
fields: None,
89+
},
90+
IdlEnumVariant {
91+
name: "Other".to_string(),
92+
fields: None,
93+
},
94+
IdlEnumVariant {
95+
name: "OldJitoLabs".to_string(),
96+
fields: None,
97+
},
98+
IdlEnumVariant {
99+
name: "TipRouter".to_string(),
100+
fields: None,
101+
},
102+
],
103+
},
104+
docs: Default::default(),
105+
generics: Default::default(),
106+
serialization: Default::default(),
107+
repr: Default::default(),
108+
})
109+
}
110+
}
111+
73112
#[derive(BorshSerialize, TypeLayout)]
74113
#[zero_copy]
75114
pub struct ValidatorHistoryEntry {

0 commit comments

Comments
 (0)