def GetListUnclaimed(self, request, context):
     payments = []
     for channel_id in payments_unclaimed:
         nonce  = payments_unclaimed[channel_id]["nonce"]
         amount = payments_unclaimed[channel_id]["amount"]
         payment = control_service_pb2.PaymentReply(
                        channel_id    = web3.Web3.toBytes(channel_id),
                        channel_nonce = web3.Web3.toBytes(nonce),
                        signed_amount = web3.Web3.toBytes(amount))
         payments.append(payment)
     return control_service_pb2.PaymentsListReply(payments = payments)
    def GetListInProgress(self, request, context):
        remove_already_claimed_payments()

        payments = []
        for channel_id in payments_in_progress:
            p = payments_in_progress[channel_id]
            payment = control_service_pb2.PaymentReply(
                           channel_id    = web3.Web3.toBytes(channel_id),
                           channel_nonce = web3.Web3.toBytes(p["nonce"]),
                           signed_amount = web3.Web3.toBytes(p["amount"]),
                           signature     = p["signature"])
            payments.append(payment)
        return control_service_pb2.PaymentsListReply(payments = payments)