예제 #1
0
from irohalib import Iroha, IrohaGrpc
from irohalib import IrohaCrypto as ic

import binascii

iroha = Iroha('admin@test')
net = IrohaGrpc()

admin_private_key = open('../[email protected]').read()

alice_private_keys = [
    b'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506caba1',
    b'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506caba2'
]
alice_public_keys = [ic.derive_public_key(x) for x in alice_private_keys]

bob_private_keys = [
    b'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506caba3',
    b'f101537e319568c765b2cc89698325604991dca57b9716b58016b253506caba4'
]
bob_public_keys = [ic.derive_public_key(x) for x in bob_private_keys]


def trace(func):
    """
    A decorator for tracing methods' begin/end execution points
    """
    def tracer(*args, **kwargs):
        name = func.__name__
        print('\tEntering "{}"'.format(name))
예제 #2
0
# SPDX-License-Identifier: Apache-2.0
#

import sys

if sys.version_info[0] < 3:
    raise Exception('Python 3 or a more recent version is required.')

from primitive_pb2 import can_set_my_account_detail
from irohalib import Iroha, IrohaGrpc
from irohalib import IrohaCrypto
import binascii

admin_private_key = open('../[email protected]').read()
user_private_key = IrohaCrypto.private_key()
user_public_key = IrohaCrypto.derive_public_key(user_private_key)
iroha = Iroha('admin@test')
net = IrohaGrpc()


def trace(func):
    """
    A decorator for tracing methods' begin/end execution points
    """
    def tracer(*args, **kwargs):
        name = func.__name__
        print('\tEntering "{}"'.format(name))
        result = func(*args, **kwargs)
        print('\tLeaving "{}"'.format(name))
        return result