Skip to content

Commit

Permalink
on the right track
Browse files Browse the repository at this point in the history
  • Loading branch information
coachchucksol committed Nov 14, 2024
1 parent 1b52c14 commit a3f78b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 8 additions & 2 deletions integration_tests/tests/fixtures/restaking_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,14 @@ impl RestakingProgramClient {
.await
}

pub async fn do_initialize_ncn(&mut self) -> TestResult<NcnRoot> {
let ncn_admin = Keypair::new();
pub async fn do_initialize_ncn(&mut self, ncn_admin: Option<Keypair>) -> TestResult<NcnRoot> {
let ncn_admin = {
if let Some(ncn_admin) = ncn_admin {
ncn_admin
} else {
self.payer.insecure_clone()
}
};
let ncn_base = Keypair::new();

self.airdrop(&ncn_admin.pubkey(), 1.0).await?;
Expand Down
8 changes: 6 additions & 2 deletions integration_tests/tests/fixtures/test_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ impl TestBuilder {

vault_program_client.do_initialize_config().await?;
restaking_program_client.do_initialize_config().await?;
let ncn_root = restaking_program_client.do_initialize_ncn().await?;
let ncn_root = restaking_program_client
.do_initialize_ncn(Some(self.context.payer.insecure_clone()))
.await?;

Ok(ncn_root)
}
Expand All @@ -160,7 +162,9 @@ impl TestBuilder {

vault_program_client.do_initialize_config().await?;
restaking_program_client.do_initialize_config().await?;
let ncn_root = restaking_program_client.do_initialize_ncn().await?;
let ncn_root = restaking_program_client
.do_initialize_ncn(Some(self.context.payer.insecure_clone()))
.await?;

tip_router_client.setup_tip_router(&ncn_root).await?;

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/tests/tip_router/set_new_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ mod tests {

fixture.warp_slot_incremental(1).await?;
let mut restaking_program_client = fixture.restaking_program_client();
let wrong_ncn_root = restaking_program_client.do_initialize_ncn().await?;
let wrong_ncn_root = restaking_program_client.do_initialize_ncn(None).await?;

let result = tip_router_client
.set_new_admin(
Expand Down

0 comments on commit a3f78b2

Please sign in to comment.