Ejemplo n.º 1
0
def cmdid(id_):
    return make_field('cmdid', 1, 'B', integer(id_, id_))
Ejemplo n.º 2
0
PROCESSED = 0
PING = 1
PONG = 2
SECRETREQUEST = 3
SECRET = 4
DIRECTTRANSFER = 5
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11
DELIVERED = 12
LOCKEXPIRED = 13

# pylint: disable=invalid-name
log = structlog.get_logger(__name__)

nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
payment_identifier = make_field('payment_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
chain_id = make_field('chain_id', 32, '32s', integer(0, UINT256_MAX))
message_identifier = make_field('message_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
delivered_message_identifier = make_field(
    'delivered_message_identifier',
    8,
    '8s',
    integer(0, UINT64_MAX),
)
expiration = make_field('expiration', 32, '32s', integer(0, UINT256_MAX))

token_network_address = make_field('token_network_address', 20, '20s')
token = make_field('token', 20, '20s')
Ejemplo n.º 3
0
ACK = to_bigendian(ACK_CMDID)
PING = to_bigendian(PING_CMDID)
# REJECTED = to_bigendian(REJECTED_CMDID)
SECRETREQUEST = to_bigendian(SECRETREQUEST_CMDID)
SECRET = to_bigendian(SECRET_CMDID)
DIRECTTRANSFER = to_bigendian(DIRECTTRANSFER_CMDID)
LOCKEDTRANSFER = to_bigendian(LOCKEDTRANSFER_CMDID)
MEDIATEDTRANSFER = to_bigendian(MEDIATEDTRANSFER_CMDID)
CANCELTRANSFER = to_bigendian(CANCELTRANSFER_CMDID)
TRANSFERTIMEOUT = to_bigendian(TRANSFERTIMEOUT_CMDID)
CONFIRMTRANSFER = to_bigendian(CONFIRMTRANSFER_CMDID)

# pylint: disable=invalid-name
log = slogging.get_logger('messages')

nonce = make_field('nonce', 8, '8s', integer(0, BYTE**8))
expiration = make_field('expiration', 8, '8s', integer(0, BYTE**8))

asset = make_field('asset', 20, '20s')
recipient = make_field('recipient', 20, '20s')
target = make_field('target', 20, '20s')
initiator = make_field('initiator', 20, '20s')
sender = make_field('sender', 20, '20s')

locksroot = make_field('locksroot', 32, '32s')
hashlock = make_field('hashlock', 32, '32s')
secret = make_field('secret', 32, '32s')
echo = make_field('echo', 32, '32s')
transfered_amount = make_field('transfered_amount', 32, '32s',
                               integer(0, BYTE**32))
amount = make_field('amount', 32, '32s', integer(0, BYTE**32))
Ejemplo n.º 4
0
PROCESSED = 0
PING = 1
PONG = 2
SECRETREQUEST = 3
UNLOCK = 4
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11
DELIVERED = 12
LOCKEXPIRED = 13

# pylint: disable=invalid-name
log = structlog.get_logger(__name__)

nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
payment_identifier = make_field('payment_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
chain_id = make_field('chain_id', 32, '32s', integer(0, UINT256_MAX))
message_identifier = make_field('message_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
current_protocol_version = make_field('current_protocol_version', 1, '1s',
                                      integer(0, 256))
delivered_message_identifier = make_field(
    'delivered_message_identifier',
    8,
    '8s',
    integer(0, UINT64_MAX),
)
expiration = make_field('expiration', 32, '32s', integer(0, UINT256_MAX))
Ejemplo n.º 5
0
REFUNDTRANSFER_CMDID = 8
REVEALSECRET_CMDID = 11

ACK = to_bigendian(ACK_CMDID)
PING = to_bigendian(PING_CMDID)
SECRETREQUEST = to_bigendian(SECRETREQUEST_CMDID)
SECRET = to_bigendian(SECRET_CMDID)
REVEALSECRET = to_bigendian(REVEALSECRET_CMDID)
DIRECTTRANSFER = to_bigendian(DIRECTTRANSFER_CMDID)
MEDIATEDTRANSFER = to_bigendian(MEDIATEDTRANSFER_CMDID)
REFUNDTRANSFER = to_bigendian(REFUNDTRANSFER_CMDID)

# pylint: disable=invalid-name
log = slogging.get_logger(__name__)

nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
identifier = make_field('identifier', 8, '8s', integer(0, UINT64_MAX))
expiration = make_field('expiration', 8, '8s', integer(0, UINT64_MAX))

token = make_field('token', 20, '20s')
recipient = make_field('recipient', 20, '20s')
target = make_field('target', 20, '20s')
initiator = make_field('initiator', 20, '20s')
sender = make_field('sender', 20, '20s')
channel = make_field('channel', 20, '20s')

locksroot = make_field('locksroot', 32, '32s')
hashlock = make_field('hashlock', 32, '32s')
secret = make_field('secret', 32, '32s')
echo = make_field('echo', 32, '32s')
transferred_amount = make_field('transferred_amount', 32, '32s',
Ejemplo n.º 6
0
PROCESSED = 0
PING = 1
PONG = 2
SECRETREQUEST = 3
UNLOCK = 4
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11
DELIVERED = 12
LOCKEXPIRED = 13
TODEVICE = 14

# pylint: disable=invalid-name
log = structlog.get_logger(__name__)

nonce = make_field("nonce", 8, "8s", integer(0, UINT64_MAX))
updating_nonce = make_field("updating_nonce", 8, "8s", integer(0, UINT64_MAX))
other_nonce = make_field("other_nonce", 8, "8s", integer(0, UINT64_MAX))
payment_identifier = make_field("payment_identifier", 8, "8s",
                                integer(0, UINT64_MAX))
chain_id = make_field("chain_id", 32, "32s", integer(0, UINT256_MAX))
message_identifier = make_field("message_identifier", 8, "8s",
                                integer(0, UINT64_MAX))
current_protocol_version = make_field("current_protocol_version", 1, "1s",
                                      integer(0, 256))
delivered_message_identifier = make_field("delivered_message_identifier", 8,
                                          "8s", integer(0, UINT64_MAX))
expiration = make_field("expiration", 32, "32s", integer(0, UINT256_MAX))

token_network_address = make_field("token_network_address", 20, "20s")
token = make_field("token", 20, "20s")
Ejemplo n.º 7
0
def cmdid(id_):
    return make_field("cmdid", 1, "B", integer(id_, id_))
Ejemplo n.º 8
0
PROCESSED = 0
PING = 1
SECRETREQUEST = 3
SECRET = 4
DIRECTTRANSFER = 5
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11


# pylint: disable=invalid-name
log = slogging.get_logger(__name__)


nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
payment_identifier = make_field('payment_identifier', 8, '8s', integer(0, UINT64_MAX))
message_identifier = make_field('message_identifier', 8, '8s', integer(0, UINT64_MAX))
processed_message_identifier = make_field(
    'processed_message_identifier',
    8,
    '8s',
    integer(0, UINT64_MAX),
)
expiration = make_field('expiration', 8, '8s', integer(0, UINT64_MAX))

token = make_field('token', 20, '20s')
recipient = make_field('recipient', 20, '20s')
target = make_field('target', 20, '20s')
initiator = make_field('initiator', 20, '20s')
sender = make_field('sender', 20, '20s')
Ejemplo n.º 9
0
def cmdid(id_):
    return make_field('cmdid', 1, 'B', integer(id_, id_))
Ejemplo n.º 10
0
PING = 1
PONG = 2
SECRETREQUEST = 3
SECRET = 4
DIRECTTRANSFER = 5
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11
DELIVERED = 12


# pylint: disable=invalid-name
log = structlog.get_logger(__name__)


nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
payment_identifier = make_field('payment_identifier', 8, '8s', integer(0, UINT64_MAX))
chain_id = make_field('chain_id', 32, '32s', integer(0, UINT256_MAX))
message_identifier = make_field('message_identifier', 8, '8s', integer(0, UINT64_MAX))
delivered_message_identifier = make_field(
    'delivered_message_identifier',
    8,
    '8s',
    integer(0, UINT64_MAX),
)
expiration = make_field('expiration', 32, '32s', integer(0, UINT256_MAX))

token_network_address = make_field('token_network_address', 20, '20s')
token = make_field('token', 20, '20s')
recipient = make_field('recipient', 20, '20s')
target = make_field('target', 20, '20s')
Ejemplo n.º 11
0
SECRETREQUEST = to_bigendian(SECRETREQUEST_CMDID)
SECRET = to_bigendian(SECRET_CMDID)
REVEALSECRET = to_bigendian(REVEALSECRET_CMDID)
DIRECTTRANSFER = to_bigendian(DIRECTTRANSFER_CMDID)
LOCKEDTRANSFER = to_bigendian(LOCKEDTRANSFER_CMDID)
MEDIATEDTRANSFER = to_bigendian(MEDIATEDTRANSFER_CMDID)
REFUNDTRANSFER = to_bigendian(REFUNDTRANSFER_CMDID)
TRANSFERTIMEOUT = to_bigendian(TRANSFERTIMEOUT_CMDID)
CONFIRMTRANSFER = to_bigendian(CONFIRMTRANSFER_CMDID)


# pylint: disable=invalid-name
log = slogging.get_logger(__name__)


nonce = make_field('nonce', 8, '8s', integer(0, BYTE ** 8))
identifier = make_field('identifier', 8, '8s', integer(0, BYTE ** 8))
expiration = make_field('expiration', 8, '8s', integer(0, BYTE ** 8))

asset = make_field('asset', 20, '20s')
recipient = make_field('recipient', 20, '20s')
target = make_field('target', 20, '20s')
initiator = make_field('initiator', 20, '20s')
sender = make_field('sender', 20, '20s')

locksroot = make_field('locksroot', 32, '32s')
hashlock = make_field('hashlock', 32, '32s')
secret = make_field('secret', 32, '32s')
echo = make_field('echo', 32, '32s')
transferred_amount = make_field('transferred_amount', 32, '32s', integer(0, BYTE ** 32))
amount = make_field('amount', 32, '32s', integer(0, BYTE ** 32))
Ejemplo n.º 12
0
SECRETREQUEST = 3
SECRET = 4
DIRECTTRANSFER = 5
LOCKEDTRANSFER = 7
REFUNDTRANSFER = 8
REVEALSECRET = 11
DELIVERED = 12
CROSSTRANSACTION = 13
ACCEPTCROSS = 14
CROSSLOCKEDTRANSFER = 15
CROSSSECRETREQUEST = 16

# pylint: disable=invalid-name
log = structlog.get_logger(__name__)

nonce = make_field('nonce', 8, '8s', integer(0, UINT64_MAX))
payment_identifier = make_field('payment_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
chain_id = make_field('chain_id', 32, '32s', integer(0, UINT256_MAX))
message_identifier = make_field('message_identifier', 8, '8s',
                                integer(0, UINT64_MAX))
delivered_message_identifier = make_field(
    'delivered_message_identifier',
    8,
    '8s',
    integer(0, UINT64_MAX),
)
expiration = make_field('expiration', 32, '32s', integer(0, UINT256_MAX))

token_network_address = make_field('token_network_address', 20, '20s')
token = make_field('token', 20, '20s')