println logs

This commit is contained in:
Tan Chee Keong
2025-03-06 15:16:48 +08:00
parent d8d31b7b01
commit cba2adbfcc

View File

@@ -135,7 +135,7 @@ async fn make_selection_proof<T: SlotClock + 'static, E: EthSpec>(
) -> Result<Option<SelectionProof>, Error> { ) -> Result<Option<SelectionProof>, Error> {
let selection_proof = if distributed { let selection_proof = if distributed {
// Submit a partial selection proof in the data field of the POST HTTP endpoint // Submit a partial selection proof in the data field of the POST HTTP endpoint
let selections = BeaconCommitteeSelection { let selection = BeaconCommitteeSelection {
validator_index: duty.validator_index, validator_index: duty.validator_index,
slot: duty.slot, slot: duty.slot,
selection_proof: validator_store selection_proof: validator_store
@@ -146,12 +146,14 @@ async fn make_selection_proof<T: SlotClock + 'static, E: EthSpec>(
}; };
// Call the endpoint /eth/v1/validator/beacon_committee_selections // Call the endpoint /eth/v1/validator/beacon_committee_selections
// The middleware should return a full selection proof here // The middleware should return a full selection proof here
beacon_nodes
let response = beacon_nodes
.first_success(|beacon_node| { .first_success(|beacon_node| {
let value = selections.clone(); let selections = selection.clone();
println!("Selection proof: {:?}", selections);
async move { async move {
beacon_node beacon_node
.post_validator_beacon_committee_selections(&[value]) .post_validator_beacon_committee_selections(&[selections])
.await .await
} }
}) })
@@ -160,7 +162,10 @@ async fn make_selection_proof<T: SlotClock + 'static, E: EthSpec>(
Error::FailedToProduceSelectionProof(ValidatorStoreError::Middleware(e.to_string())) Error::FailedToProduceSelectionProof(ValidatorStoreError::Middleware(e.to_string()))
})? })?
.data[0] .data[0]
.clone() .clone();
println!("Response: {:?}", response);
response
} else { } else {
validator_store validator_store
.produce_selection_proof(duty.pubkey, duty.slot) .produce_selection_proof(duty.pubkey, duty.slot)