Ejemplo n.º 1
0
    def __init__(self, sender, tx_params, gas_used=constants["SIMPLE_TRANSACTION_GAS"], tx_hash=None, rng=rng):
        self.sender = sender
        self.start_block = tx_params["start_block"]
        self.gas_used = gas_used

        if tx_hash is None:
            self.tx_hash = rng.bytes(8)
        else:
            self.tx_hash = tx_hash
Ejemplo n.º 2
0
    def __init__(self, wakeup_block, pub_key=None, value=None, rng=rng):
        self.wakeup_block = wakeup_block
        self.rng = rng

        if pub_key is None:
            self.pub_key = rng.bytes(8)
        else:
            self.pub_key = pub_key

        # Users have a value (in wei) per unit of gas for the transaction
        if value is None:
            self.value = int(rng.uniform(low=0, high=20) * (10**9))
        else:
            self.value = value
Ejemplo n.º 3
0
 def __init__(self, txs, parent_hash, height, rng=rng):
     self.block_hash = rng.bytes(8)
     self.txs = txs
     self.parent_hash = parent_hash
     self.height = height