application/ClientUtil.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 validateIssuerBlock(blockData) {
        let issuerOK = await this.verifyIssuer(blockData);
        let recipientsOK = await this.validateIssuerRecipients(blockData);
        let datetimeOK = await this.validateIssuerDateTime(blockData);
        let merkleRootIssuerTest = BeanDataBlock.calculateMerkleRootIssuer(blockData);
        let merkleRootIssuer = blockData.merkleRootIssuer;
        if (merkleRootIssuer != merkleRootIssuerTest) {
            logWrite('[validateIssuerBlock] Issuer Merkle Root Hash Invalid');
            return false;
        }
        logWrite('[validateIssuerBlock] Issuer Merkle Root Hash Is Valid');
        let valueToReturn = false;
        if (issuerOK && recipientsOK && datetimeOK) {
            valueToReturn = true;
        }
        return valueToReturn;
    }
async validateIssuerBlock ( blockData ) { let issuerOK = await this . verifyIssuer ( blockData ) ; let recipientsOK = await this . validateIssuerRecipients ( blockData ) ; let datetimeOK = await this . validateIssuerDateTime ( blockData ) ; let merkleRootIssuerTest = BeanDataBlock . calculateMerkleRootIssuer ( blockData ) ; let merkleRootIssuer = blockData . merkleRootIssuer ; if ( merkleRootIssuer != merkleRootIssuerTest ) { logWrite ( '[validateIssuerBlock] Issuer Merkle Root Hash Invalid' ) ; return false ; } logWrite ( '[validateIssuerBlock] Issuer Merkle Root Hash Is Valid' ) ; let valueToReturn = false ; if ( issuerOK && 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 .
// Issuer: Validar Dados --------------------------- // logWrite('[validateIssuerBlock] issuerOK: ' + issuerOK); // Recipients: Validar Dados --------------------------- // logWrite('[validateIssuerBlock] recipientsOK: ' + recipientsOK); // Date-Time: Validar Dados --------------------------- // logWrite('[validateIssuerBlock] datetimeOK: ' + datetimeOK); // Issuer Merkle Hash: Validar Dados --------------------------- // stop here