pub fn new_internal(
        payload: T,
        parent_id: HashValue,
        round: Round,
        height: Height,
        timestamp_usecs: u64,
        quorum_cert: QuorumCert,
        validator_signer: &ValidatorSigner<Ed25519PrivateKey>,
    ) -> Self {
        let block_internal = BlockSerializer {
            parent_id,
            payload: &payload,
            round,
            height,
            timestamp_usecs,
            quorum_cert: &quorum_cert,
            author: Some(validator_signer.author()),
        };

        let id = block_internal.hash();
        let signature = validator_signer
            .sign_message(id)
            .expect("Failed to sign message");

        Block {
            id,
            payload,
            parent_id,
            round,
            height,
            timestamp_usecs,
            quorum_cert,
            block_source: BlockSource::Proposal {
                author: validator_signer.author(),
                signature,
            },
        }
    }
// Create a block directly.  Most users should prefer make_block() as it ensures correct block
// chaining.  This functionality should typically only be used for testing.
Create a block directly.  Most users should prefer make_block() as it ensures correct block
chaining.  This functionality should typically only be used for testing.
Create a block directly . Most users should prefer make_block () as it ensures correct block chaining . This functionality should typically only be used for testing .
pub fn new_internal(
        payload: T,
        parent_id: HashValue,
        round: Round,
        height: Height,
        timestamp_usecs: u64,
        quorum_cert: QuorumCert,
        validator_signer: &ValidatorSigner<Ed25519PrivateKey>,
    ) -> Self {
        let block_internal = BlockSerializer {
            parent_id,
            payload: &payload,
            round,
            height,
            timestamp_usecs,
            quorum_cert: &quorum_cert,
            author: Some(validator_signer.author()),
        };
        let id = block_internal.hash();
        let signature = validator_signer
            .sign_message(id)
            .expect("Failed to sign message");
        Block {
            id,
            payload,
            parent_id,
            round,
            height,
            timestamp_usecs,
            quorum_cert,
            block_source: BlockSource::Proposal {
                author: validator_signer.author(),
                signature,
            },
        }
    }
pub fn new_internal ( payload : T , parent_id : HashValue , round : Round , height : Height , timestamp_usecs : u64 , quorum_cert : QuorumCert , validator_signer : & ValidatorSigner < Ed25519PrivateKey > , ) -> Self { let block_internal = BlockSerializer { parent_id , payload : & payload , round , height , timestamp_usecs , quorum_cert : & quorum_cert , author : Some ( validator_signer . author ( ) ) , } ; let id = block_internal . hash ( ) ; let signature = validator_signer . sign_message ( id ) . expect ( " " ) ; Block { id , payload , parent_id , round , height , timestamp_usecs , quorum_cert , block_source : BlockSource :: Proposal { author : validator_signer . author ( ) , signature , } , } }
Create a block directly.
Create a block directly .
payload
T
parent_id
HashValue
round
Round
height
Height
timestamp_usecs
u64
quorum_cert
QuorumCert
validator_signer
&ValidatorSigner<Ed25519PrivateKey>
payload
T
parent_id
HashValue
round
Round
height
Height
timestamp_usecs
u64
quorum_cert
QuorumCert
validator_signer
&ValidatorSigner<Ed25519PrivateKey>