// ===============================================
// readAuthScene - read a authScene from chaincode state
// ===============================================
read a authScene from chaincode state
// =============================================== // readAuthScene - read a authScene from chaincode state // ===============================================
func (t *AuthChaincode) readAuthScene(stub shim.ChaincodeStubInterface, args []string) pb.Response {
        var authId, jsonResp string
        var err error
        if len(args) != 1 {
                return shim.Error("Incorrect number of arguments. Expecting id of the authInfo to query")
        }
        authId = args[0]
        valAsbytes, err := stub.GetState(authId) 
        if err != nil {
                jsonResp = "{\"Error\":\"Failed to get state for " + authId + "\"}"
                return shim.Error(jsonResp)
        } else if valAsbytes == nil {
                jsonResp = "{\"Error\":\"Auth info does not exist: " + authId + "\"}"
                return shim.Error(jsonResp)
        }
        return shim.Success(valAsbytes)
}
func ( t * AuthChaincode ) readAuthScene ( stub shim . ChaincodeStubInterface , args [ ] string ) pb . Response { var authId , jsonResp string var err error if len ( args ) != 1 { return shim . Error ( " " ) } authId = args [ 0 ] valAsbytes , err := stub . GetState ( authId ) if err != nil { jsonResp = " \" \" \" " + authId + " \" " return shim . Error ( jsonResp ) } else if valAsbytes == nil { jsonResp = " \" \" \" " + authId + " \" " return shim . Error ( jsonResp ) } return shim . Success ( valAsbytes ) }
read a authScene from chaincode state
read a authScene from chaincode state
//get the authScene from chaincode state