hashgraph / hedera-hcs-corda-demo

Integrating R3 Corda IOU Demo with the Hedera Consensus Service.
Apache License 2.0
3 stars 3 forks source link

When the validating attribute is turned on, error sends message as it is not prepared for a Signed Transaction #8

Open JaimeSilver opened 4 years ago

JaimeSilver commented 4 years ago

When the notary node is turned as a Validating node [validating = true], the HcsNotaryServiceFlow is not prepared to receive a Signed Transaction and gives an error. Changing the transaction payload gets access to the State: SignedTransaction sTxn = payload.getSignedTransaction(); System.out.println("received Signed txn: " + sTxn); CoreTransaction txn = sTxn.getCoreTransaction();

    if ( txn.getOutputStates().size() != 0 ){
        ContractState outputState = txn.getOutput(0);
        Obligation obligationState = (Obligation) outputState;
        System.out.println("Amount: " + obligationState.getAmount());
        System.out.println("Lender: " + obligationState.getLender());
        System.out.println("Borrower: " + obligationState.getBorrower());
    }