contract/business/NotarizeOps.js
/**
     * 
     * @param {BeanDataBlock} blockData Data block with the set of process information.
     */
@param {BeanDataBlock} blockData Data block with the set of process information.
@param { BeanDataBlock } blockData Data block with the set of process information .
async validateValidatorBlock(blockData) {
        let validatorOK = await this.verifyValidator(blockData);
        logWrite('[validateValidatorBlock] validatorOK: ' + validatorOK);
        let recipientsOK = await this.validateValidatorRecipients(blockData);
        logWrite('[validateValidatorBlock] recipientsOK: ' + recipientsOK);
        let datetimeOK = await this.validateValidatorDateTime(blockData);
        logWrite('[validateValidatorBlock] datetimeOK: ' + datetimeOK);
        let merkleRootValidatorTest = BeanDataBlock.calculateMerkleRootValidator(blockData);
        let merkleRootValidator = blockData.merkleRootValidator;
        if (merkleRootValidator != merkleRootValidatorTest) {
            logWrite('[validateValidatorBlock] Validator Merkle Root Hash Invalid');
            return false;
        }
        logWrite('[validateValidatorBlock] Validator Merkle Root Hash Is Valid');
        let valueToReturn = false;
        if (validatorOK && recipientsOK && datetimeOK) {
            valueToReturn = true;
        }
        return valueToReturn;
    }
async validateValidatorBlock ( blockData ) { let validatorOK = await this . verifyValidator ( blockData ) ; logWrite ( '[validateValidatorBlock] validatorOK: ' + validatorOK ) ; let recipientsOK = await this . validateValidatorRecipients ( blockData ) ; logWrite ( '[validateValidatorBlock] recipientsOK: ' + recipientsOK ) ; let datetimeOK = await this . validateValidatorDateTime ( blockData ) ; logWrite ( '[validateValidatorBlock] datetimeOK: ' + datetimeOK ) ; let merkleRootValidatorTest = BeanDataBlock . calculateMerkleRootValidator ( blockData ) ; let merkleRootValidator = blockData . merkleRootValidator ; if ( merkleRootValidator != merkleRootValidatorTest ) { logWrite ( '[validateValidatorBlock] Validator Merkle Root Hash Invalid' ) ; return false ; } logWrite ( '[validateValidatorBlock] Validator Merkle Root Hash Is Valid' ) ; let valueToReturn = false ; if ( validatorOK && recipientsOK && datetimeOK ) { valueToReturn = true ; } return valueToReturn ; }
@param {BeanDataBlock} blockData Data block with the set of process information.
@param { BeanDataBlock } blockData Data block with the set of process information .
// Validator: Validar Dados --------------------------- // Recipients: Validar Dados --------------------------- // Date-Time: Validar Dados --------------------------- // Validator Merkle Hash: Validar Dados --------------------------- // stop here