Beispiel #1
0
def sender_to_receiver(sender_addr, receiver_addr, channel_name, asset_type, count):
    """
    :param sender_addr: String, the sender address
    :param receiver_addr: String, receiver's address
    :param channel_name: String, channel name
    :param asset_type: String, asset type should be symbol name , asset id should be configured in the configure.json
    :param count:  String, depoist number in block chain
    :return:
    """
    sender,receiver = split_channel_name(channel_name)
    ch = Channel(sender,receiver)
    if sender_addr == ch.sender and receiver_addr == ch.receiver:
        return ch.sender_to_receiver(float(count))
    elif receiver_addr == ch.sender and sender_addr == ch.receiver:
        return ch.receiver_to_sender(float(count))
    else:
        return {"error":"Address and Channelname not match"}
Beispiel #2
0
def sender_to_receiver(sender_addr, receiver_addr, channel_name, asset_type,
                       count):
    """

    :param sender_addr:
    :param receiver_addr:
    :param channel_name:
    :param asset_type:
    :param count:
    :return:
    """
    sender, receiver = split_channel_name(channel_name)
    ch = Channel(sender, receiver)
    if sender_addr == ch.sender and receiver_addr == ch.receiver:
        return ch.sender_to_receiver(int(count))
    elif receiver_addr == ch.sender and sender_addr == ch.receiver:
        return ch.receiver_to_sender(int(count))
    else:
        return {"error": "Address and Channelname not match"}