Skip to content

Commit ceed2c4

Browse files
committed
Failing: cargo test --test 02_commit_and_undelegate test_committing_and_undelegating_one_account --profile test -- --nocapture
1 parent 9d49a9d commit ceed2c4

File tree

4 files changed

+49
-6
lines changed

4 files changed

+49
-6
lines changed

test-integration/configs/run-test-validator.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ solana-test-validator \
44
--log \
55
--rpc-port 7799 \
66
-r \
7-
--account tEsT3eV6RFCWs1BZ7AXTzasHqTtMnMLCB2tjQ42TDXD \
7+
--account mAGicPQYBMvcYveUZA5F5UNNwyHvfYh5xkLS2Fr1mev \
88
$DIR/accounts/validator-authority.json \
9-
--account DUH8h7rYjdTPYyBUEGAUwZv9ffz5wiM45GdYWYzogXjp \
9+
--account EpJnX7ueXk7fKojBymqmVuCuwyhDQsYcLVL1XMsBbvDX \
1010
$DIR/accounts/validator-fees-vault.json \
1111
--account 7JrkjmZPprHwtuvtuGTXp9hwfGYFAQLnLeFM52kqAgXg \
1212
$DIR/accounts/protocol-fees-vault.json \

test-integration/programs/flexi-counter/src/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ fn process_add_and_schedule_commit(
342342
// Request the PDA counter account to be committed
343343
if undelegate {
344344
msg!("invoke commit_and_undelegate_accounts");
345-
commit_diff_and_undelegate_accounts(
345+
commit_and_undelegate_accounts(
346346
payer_info,
347347
vec![counter_pda_info],
348348
magic_context_info,

test-integration/run-test-validator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2+
#--log \
23
solana-test-validator \
3-
--log \
44
--rpc-port \
55
7799 \
66
-r \

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

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ pub fn extract_scheduled_commit_sent_signature_from_logs(
2727
None
2828
}
2929

30+
pub fn extract_base_chain_commit_signature_from_logs(
31+
logs: &[String],
32+
) -> Option<Signature> {
33+
// ScheduledCommitSent signature: <signature>
34+
for log in logs {
35+
if log.starts_with("ScheduledCommitSent signature[0]: ") {
36+
let commit_sig =
37+
log.split_whitespace().last().expect("No signature found");
38+
return Signature::from_str(commit_sig).ok();
39+
}
40+
}
41+
None
42+
}
43+
3044
#[allow(clippy::type_complexity)]
3145
pub fn extract_sent_commit_info_from_logs(
3246
logs: &[String],
@@ -208,9 +222,38 @@ impl IntegrationTestContext {
208222
ephem_logs, scheduled_commmit_sent_sig
209223
)
210224
})?;
225+
// let (chain_logs, base_sig) = {
226+
// let logs = self
227+
// .fetch_ephemeral_logs(scheduled_commmit_sent_sig)
228+
// .with_context(|| {
229+
// format!(
230+
// "Logs {:#?}\nScheduled commit sent sig {:?}",
231+
// ephem_logs, scheduled_commmit_sent_sig
232+
// )
233+
// })?;
234+
// let sig =
235+
// extract_base_chain_commit_signature_from_logs(&logs)
236+
// .with_context(|| {
237+
// format!("ScheduledCommitSent signature not found in logs, {:#?}", logs)
238+
// })?;
239+
240+
// (logs, sig)
241+
// };
242+
243+
// println!("CHAIN_LOGS: {:#?}", chain_logs);
244+
// println!("Found chain commit signatures: {scheduled_commmit_sent_sig} / {base_sig}");
245+
246+
// self.dump_ephemeral_logs(base_sig);
247+
// self.dump_chain_logs(base_sig);
248+
249+
// let base_logs = self.fetch_chain_logs(base_sig).with_context(|| {
250+
// format!(
251+
// "\x1b[31m{:#?} \n {:#?} \n {} / {}\n\x1b[0m",
252+
// ephem_logs, chain_logs, scheduled_commmit_sent_sig, base_sig
253+
// )
254+
// })?;
211255

212-
println!("CHAIN_LOGS: {:#?}", chain_logs);
213-
println!("Found chain commit signatures");
256+
// println!("BASE CHAIN_LOGS: {:#?}", base_logs);
214257

215258
let (included, excluded, feepayers, sigs) =
216259
extract_sent_commit_info_from_logs(&chain_logs);

0 commit comments

Comments
 (0)