Skip to content

Commit 4a5d8e2

Browse files
committed
fix ci lint etc
1 parent 45d5b50 commit 4a5d8e2

File tree

6 files changed

+32
-169
lines changed

6 files changed

+32
-169
lines changed

test-integration/schedulecommit/client/src/schedule_commit_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl ScheduleCommitTestContext {
113113
)
114114
.unwrap();
115115
let (pda, _bump) = Pubkey::find_program_address(
116-
&[user_seed, &payer_ephem.pubkey().as_ref()],
116+
&[user_seed, payer_ephem.pubkey().as_ref()],
117117
&program_schedulecommit::ID,
118118
);
119119
(payer_ephem, pda)

test-integration/schedulecommit/test-scenarios/tests/03_commits_fee_payer.rs

Lines changed: 0 additions & 135 deletions
This file was deleted.

test-integration/schedulecommit/test-security/tests/01_invocations.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ const NEEDS_TO_BE_OWNED_BY_INVOKING_PROGRAM: &str =
2727

2828
fn prepare_ctx_with_account_to_commit() -> ScheduleCommitTestContext {
2929
let ctx = if std::env::var("FIXED_KP").is_ok() {
30-
ScheduleCommitTestContext::try_new(2)
30+
ScheduleCommitTestContext::try_new(2, b"magic_schedule_commit")
3131
} else {
32-
ScheduleCommitTestContext::try_new_random_keys(2)
32+
ScheduleCommitTestContext::try_new_random_keys(
33+
2,
34+
b"magic_schedule_commit",
35+
)
3336
}
3437
.unwrap();
3538
ctx.init_committees().unwrap();

test-integration/test-committor-service/tests/common.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ pub fn generate_random_bytes(length: usize) -> Vec<u8> {
149149
#[allow(dead_code)]
150150
pub fn create_commit_task(data: &[u8]) -> CommitTask {
151151
static COMMIT_ID: AtomicU64 = AtomicU64::new(0);
152-
CommitTask {
153-
commit_id: COMMIT_ID.fetch_add(1, Ordering::Relaxed),
154-
allow_undelegation: false,
155-
committed_account: CommittedAccount {
152+
CommitTask::new(
153+
COMMIT_ID.fetch_add(1, Ordering::Relaxed),
154+
false,
155+
CommittedAccount {
156156
pubkey: Pubkey::new_unique(),
157157
account: Account {
158158
lamports: 1000,
@@ -162,7 +162,7 @@ pub fn create_commit_task(data: &[u8]) -> CommitTask {
162162
rent_epoch: 0,
163163
},
164164
},
165-
}
165+
)
166166
}
167167

168168
#[allow(dead_code)]

test-integration/test-committor-service/tests/test_transaction_preparator.rs

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ async fn test_prepare_commit_tx_with_single_account() {
3535
let committed_account = create_committed_account(&account_data);
3636

3737
let tasks = vec![
38-
Box::new(ArgsTask::new(ArgsTaskType::Commit(CommitTask {
39-
commit_id: 1,
40-
committed_account: committed_account.clone(),
41-
allow_undelegation: true,
42-
}))) as Box<dyn BaseTask>,
38+
Box::new(ArgsTask::new(ArgsTaskType::Commit(CommitTask::new(
39+
1,
40+
true,
41+
committed_account.clone(),
42+
)))) as Box<dyn BaseTask>,
4343
Box::new(ArgsTask::new(ArgsTaskType::Finalize(FinalizeTask {
4444
delegated_account: committed_account.pubkey,
4545
}))),
@@ -89,21 +89,18 @@ async fn test_prepare_commit_tx_with_multiple_accounts() {
8989
let account2_data = generate_random_bytes(12);
9090
let committed_account2 = create_committed_account(&account2_data);
9191

92-
let buffer_commit_task = BufferTask::new_preparation_required(
93-
BufferTaskType::Commit(CommitTask {
94-
commit_id: 1,
95-
committed_account: committed_account2.clone(),
96-
allow_undelegation: true,
97-
}),
98-
);
92+
let buffer_commit_task =
93+
BufferTask::new_preparation_required(BufferTaskType::Commit(
94+
CommitTask::new(1, true, committed_account2.clone()),
95+
));
9996
// Create test data
10097
let tasks = vec![
10198
// account 1
102-
Box::new(ArgsTask::new(ArgsTaskType::Commit(CommitTask {
103-
commit_id: 1,
104-
committed_account: committed_account1.clone(),
105-
allow_undelegation: true,
106-
}))) as Box<dyn BaseTask>,
99+
Box::new(ArgsTask::new(ArgsTaskType::Commit(CommitTask::new(
100+
1,
101+
true,
102+
committed_account1.clone(),
103+
)))) as Box<dyn BaseTask>,
107104
// account 2
108105
Box::new(buffer_commit_task),
109106
// finalize account 1
@@ -186,13 +183,10 @@ async fn test_prepare_commit_tx_with_base_actions() {
186183
}],
187184
};
188185

189-
let buffer_commit_task = BufferTask::new_preparation_required(
190-
BufferTaskType::Commit(CommitTask {
191-
commit_id: 1,
192-
committed_account: committed_account.clone(),
193-
allow_undelegation: true,
194-
}),
195-
);
186+
let buffer_commit_task =
187+
BufferTask::new_preparation_required(BufferTaskType::Commit(
188+
CommitTask::new(1, true, committed_account.clone()),
189+
));
196190
let tasks = vec![
197191
// commit account
198192
Box::new(buffer_commit_task.clone()) as Box<dyn BaseTask>,

test-integration/test-tools/src/integration_test_context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ impl IntegrationTestContext {
154154
rpc_client: Option<&RpcClient>,
155155
label: &str,
156156
) -> Option<Vec<String>> {
157-
let rpc_client = rpc_client
158-
.expect(&format!("rpc_client for [{label}] does not exist"));
157+
let rpc_client = rpc_client.unwrap_or_else(|| {
158+
panic!("rpc_client for [{label}] does not exist")
159+
});
159160

160161
// Try this up to 50 times since devnet here returns the version response instead of
161162
// the EncodedConfirmedTransactionWithStatusMeta at times

0 commit comments

Comments
 (0)