contract/business/NotarizeDocument.js
/**
     * Upgrade to perform any configuration of the ledger that might be required.
     * @param {Context} ctx the transaction context
     */
Upgrade to perform any configuration of the ledger that might be required.
@param {Context} ctx the transaction context
Upgrade to perform any configuration of the ledger that might be required . @param { Context } ctx the transaction context
async upgrade(ctx) {
        var response = ResponseModel.newResponseModel();
        try {
            let message = `Upgrade the smart contract ${CONTRACTNAME}, object ${ContractNotarizeDocument}, with version ${CONTRACTVERSION}`;
            logWrite(`[upgrade] ${message}`);
            response.setTxMessage(message);
            response.setTxStatus(ResponseModel.getTxStatusType().SUCCESS);
            response.setTxContent(ResponseModel.getTxStatusType().EMPTY);
        } catch (error) {
            console.log(error);
            console.log(error.stack);
            response.setTxMessage(error.toString());
            response.setTxStatus(ResponseModel.getTxStatusType().FAIL);
            response.setTxContent(error.stack);
        }
        logWrite(`[upgrade] ${response.serialize()}`);
        logWrite(`\n-->[ upgrade ]<-- BEFORE RETURN -- ${lines}`);
        return response.toBuffer();
    }
async upgrade ( ctx ) { var response = ResponseModel . newResponseModel ( ) ; try { let message = ` ${ CONTRACTNAME } ${ ContractNotarizeDocument } ${ CONTRACTVERSION } ` ; logWrite ( ` ${ message } ` ) ; response . setTxMessage ( message ) ; response . setTxStatus ( ResponseModel . getTxStatusType ( ) . SUCCESS ) ; response . setTxContent ( ResponseModel . getTxStatusType ( ) . EMPTY ) ; } catch ( error ) { console . log ( error ) ; console . log ( error . stack ) ; response . setTxMessage ( error . toString ( ) ) ; response . setTxStatus ( ResponseModel . getTxStatusType ( ) . FAIL ) ; response . setTxContent ( error . stack ) ; } logWrite ( ` ${ response . serialize ( ) } ` ) ; logWrite ( ` \n ${ lines } ` ) ; return response . toBuffer ( ) ; }
Upgrade to perform any configuration of the ledger that might be required.
Upgrade to perform any configuration of the ledger that might be required .
// Must return a serialized object to caller of smart contract