コード例 #1
0
 def setUp(self):
     super().setUp()
     self.directory = tempfile.mkdtemp()
     self.manager = self.create_peer('testnet', unlock_wallet=True)
     self.storage = self.manager.tx_storage
     # read genesis keys
     self.genesis_private_key = get_genesis_key()
     self.genesis_public_key = self.genesis_private_key.public_key()
コード例 #2
0
 def setUp(self):
     super().setUp()
     self.directory = tempfile.mkdtemp(dir='/tmp/')
     self.storage = TransactionMemoryStorage()
     self.manager = self.create_peer('testnet', unlock_wallet=True)
     # read genesis keys
     self.genesis_private_key = get_genesis_key()
     self.genesis_public_key = self.genesis_private_key.public_key()
コード例 #3
0
    def setUp(self):
        super().setUp()
        self.genesis_blocks = [tx for tx in get_genesis_transactions(None) if tx.is_block]
        self.genesis_txs = [tx for tx in get_genesis_transactions(None) if not tx.is_block]

        # read genesis keys
        self.genesis_private_key = get_genesis_key()
        self.genesis_public_key = self.genesis_private_key.public_key()
コード例 #4
0
def get_genesis_output():
    # use this if to calculate the genesis output. We have to do it if:
    # - we change genesis priv/pub keys
    # - there's some change to the way we calculate hathor addresses
    from hathor.transaction.scripts import P2PKH
    from hathor.crypto.util import get_address_from_public_key
    # read genesis keys
    genesis_private_key = get_genesis_key()
    address = get_address_from_public_key(genesis_private_key.public_key())
    return P2PKH.create_output_script(address).hex()
コード例 #5
0
    def setUp(self):
        super().setUp()
        tx_storage = TransactionMemoryStorage()
        self.genesis_blocks = [
            tx for tx in tx_storage.get_all_genesis() if tx.is_block
        ]
        self.genesis_txs = [
            tx for tx in tx_storage.get_all_genesis() if not tx.is_block
        ]

        # read genesis keys
        self.genesis_private_key = get_genesis_key()
        self.genesis_public_key = self.genesis_private_key.public_key()
コード例 #6
0
    def setUp(self):
        super().setUp()
        self.wallet = Wallet()
        self.tx_storage = TransactionMemoryStorage()
        self.genesis = self.tx_storage.get_all_genesis()
        self.genesis_blocks = [tx for tx in self.genesis if tx.is_block]
        self.genesis_txs = [tx for tx in self.genesis if not tx.is_block]

        # read genesis keys
        self.genesis_private_key = get_genesis_key()
        self.genesis_public_key = self.genesis_private_key.public_key()

        # this makes sure we can spend the genesis outputs
        self.manager = self.create_peer('testnet', tx_storage=self.tx_storage, unlock_wallet=True)
        blocks = add_blocks_unlock_reward(self.manager)
        self.last_block = blocks[-1]
コード例 #7
0
    def setUp(self):
        super().setUp()
        self.manager = self.create_peer('testnet', unlock_wallet=True, wallet_index=True)

        self.genesis = self.manager.tx_storage.get_all_genesis()
        self.genesis_blocks = [tx for tx in self.genesis if tx.is_block]
        self.genesis_txs = [tx for tx in self.genesis if not tx.is_block]

        self.address_b58 = self.manager.wallet.get_unused_address()
        self.address = decode_address(self.address_b58)

        # read genesis keys
        self.genesis_private_key = get_genesis_key()
        self.genesis_public_key = self.genesis_private_key.public_key()

        # add some blocks so we can spend the genesis outputs
        add_blocks_unlock_reward(self.manager)