How to use the @hyperledger/caliper-core.CaliperUtils.checkAllProperties function in @hyperledger/caliper-core

To help you get started, we’ve selected a few @hyperledger/caliper-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / caliper / packages / caliper-fabric / lib / fabricNetwork.js View on Github external
getAdminCryptoContentOfOrganization(org) {
        let orgObject = this.network.organizations[org];

        // if either is missing, the result is undefined
        if (!CaliperUtils.checkAllProperties(orgObject, 'adminPrivateKey', 'signedCert')) {
            return undefined;
        }

        let privateKey = orgObject.adminPrivateKey;
        let signedCert = orgObject.signedCert;

        let privateKeyPEM;
        let signedCertPEM;

        if (CaliperUtils.checkProperty(privateKey, 'path')) {
            privateKeyPEM = fs.readFileSync(privateKey.path);
        } else {
            privateKeyPEM = privateKey.pem;
        }

        if (CaliperUtils.checkProperty(signedCert, 'path')) {
github hyperledger / caliper / packages / caliper-fabric / lib / fabricNetwork.js View on Github external
getClientCryptoContent(client) {
        let clientObject = this.network.clients[client].client;

        if (!CaliperUtils.checkAllProperties(clientObject, 'clientPrivateKey', 'clientSignedCert')) {
            return undefined;
        }

        let privateKey = clientObject.clientPrivateKey;
        let signedCert = clientObject.clientSignedCert;
        let privateKeyPEM;
        let signedCertPEM;

        if (CaliperUtils.checkProperty(privateKey, 'path')) {
            privateKeyPEM = fs.readFileSync(privateKey.path);
        } else {
            privateKeyPEM = privateKey.pem;
        }

        if (CaliperUtils.checkProperty(signedCert, 'path')) {
            signedCertPEM = fs.readFileSync(signedCert.path);