MCPcopy Create free account
hub / github.com/SeismicSystems/summit / get_default_engine_config

Function get_default_engine_config

node/src/test_harness/common.rs:612–655  ·  view source on GitHub ↗

Create an EngineConfig with default values for testing # Arguments `engine_client` - Generic engine client implementing the EngineClient trait `partition_prefix` - String identifier for partitioning (typically validator ID) `genesis_hash` - 32-byte array representing the genesis block hash `namespace` - String namespace identifier (typically "_SUMMIT") `signer` - Private key for signing operation

(
    engine_client: C,
    oracle: O,
    partition_prefix: String,
    genesis_hash: [u8; 32],
    namespace: String,
    key_store: KeyStore<S>,
    participants: Vec<(PublicKey, bls12381::PublicKe

Source from the content-addressed store, hash-verified

610/// Convert a list of ExecutionRequests to Requests
611///
612/// # Arguments
613/// * `execution_requests` - A vector of ExecutionRequest instances
614///
615/// # Returns
616/// * `Requests` - The corresponding Requests value for use with the engine
617pub fn execution_requests_to_requests(execution_requests: Vec<ExecutionRequest>) -> Requests {
618 let mut deposit_payload = Vec::new();
619 let mut withdrawal_payload = Vec::new();
620 let mut protocol_param_payload = Vec::new();
621
622 for execution_request in execution_requests {
623 match execution_request {
624 ExecutionRequest::Deposit(deposit) => deposit.write(&mut deposit_payload),
625 ExecutionRequest::Withdrawal(withdrawal) => withdrawal.write(&mut withdrawal_payload),
626 ExecutionRequest::ProtocolParam(protocol_param) => {
627 protocol_param.write(&mut protocol_param_payload)
628 }
629 }
630 }
631
632 let mut requests_bytes = Vec::new();
633 if !deposit_payload.is_empty() {
634 let mut request_bytes = vec![0x00];
635 request_bytes.extend_from_slice(&deposit_payload);
636 requests_bytes.push(Bytes::from(request_bytes));
637 }
638 if !withdrawal_payload.is_empty() {
639 let mut request_bytes = vec![0x01];
640 request_bytes.extend_from_slice(&withdrawal_payload);
641 requests_bytes.push(Bytes::from(request_bytes));
642 }
643 if !protocol_param_payload.is_empty() {
644 let mut request_bytes = vec![0xFF];
645 request_bytes.extend_from_slice(&protocol_param_payload);
646 requests_bytes.push(Bytes::from(request_bytes));
647 }
648
649 Requests::from(requests_bytes)
650}
651
652/// Create an EngineConfig with default values for testing
653///
654/// # Arguments
655/// * `engine_client` - Generic engine client implementing the EngineClient trait
656/// * `partition_prefix` - String identifier for partitioning (typically validator ID)
657/// * `genesis_hash` - 32-byte array representing the genesis block hash
658/// * `namespace` - String namespace identifier (typically "_SUMMIT")

Calls

no outgoing calls