Skip to content

Commit 74024a6

Browse files
committed
example of something that works
1 parent d74a5be commit 74024a6

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

test-validator/src/lib.rs

+20-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ use {
5252
pubkey::Pubkey,
5353
rent::Rent,
5454
signature::{read_keypair_file, write_keypair_file, Keypair, Signer},
55+
sysvar::{
56+
self,
57+
epoch_rewards::{self, EpochRewards},
58+
Sysvar,
59+
},
5560
},
5661
solana_streamer::socket::SocketAddrSpace,
5762
solana_tpu_client::tpu_client::DEFAULT_TPU_ENABLE_UDP,
@@ -138,7 +143,7 @@ pub struct TestValidatorGenesis {
138143

139144
impl Default for TestValidatorGenesis {
140145
fn default() -> Self {
141-
Self {
146+
let mut test_validator_genesis = Self {
142147
fee_rate_governor: FeeRateGovernor::default(),
143148
ledger_path: Option::<PathBuf>::default(),
144149
tower_storage: Option::<Arc<dyn TowerStorage>>::default(),
@@ -167,7 +172,20 @@ impl Default for TestValidatorGenesis {
167172
geyser_plugin_manager: Arc::new(RwLock::new(GeyserPluginManager::new())),
168173
admin_rpc_service_post_init:
169174
Arc::<RwLock<Option<AdminRpcRequestMetadataPostInit>>>::default(),
170-
}
175+
};
176+
177+
test_validator_genesis.add_account(
178+
epoch_rewards::id(),
179+
AccountSharedData::create(
180+
1,
181+
vec![0; EpochRewards::size_of()],
182+
sysvar::id(),
183+
false,
184+
u64::MAX,
185+
),
186+
);
187+
188+
test_validator_genesis
171189
}
172190
}
173191

0 commit comments

Comments
 (0)