def run_test(self):
    self.node = self.nodes[0]
    self.node.generate((100 + COINBASE_MATURITY))
    tx = CTransaction()
    '\n            contract Test {\n                function() {\n                    while(msg.gas > 0) {}\n                }\n            }\n        '
    contract_address = self.node.createcontract('EXAMPLE_KEY')['address']
    self.node.generate(1)
    tx = CTransaction()
    tx.vin = [make_vin(self.node, ((NUM_OUTPUTS * 5) * COIN))]
    tx.vout = [CTxOut(0, CScript([b'\x04', int((5 * COIN)), BEERCHAIN_MIN_GAS_PRICE, b'\x00', bytes.fromhex(contract_address), OP_CALL])) for i in range(NUM_OUTPUTS)]
    tx.rehash()
    signed_tx_hex = self.node.signrawtransactionwithwallet(bytes_to_hex_str(tx.serialize()))['hex']
    try:
        self.node.sendrawtransaction(signed_tx_hex)
    except:
        pass
    print('Tx size', len(signed_tx_hex))
    t = time.time()
    self.node.generate(1)
    execution_time = (time.time() - t)
    print('execution time:', execution_time, 'seconds')
    assert (execution_time < 60)
def run_test(self):
    self.node = self.nodes[0]
    self.node.generate((100 + COINBASE_MATURITY))
    tx = CTransaction()
    '\n            contract Test {\n                function() {\n                    while(msg.gas > 0) {}\n                }\n            }\n        '
    contract_address = self.node.createcontract('EXAMPLE_KEY')['address']
    self.node.generate(1)
    tx = CTransaction()
    tx.vin = [make_vin(self.node, ((NUM_OUTPUTS * 5) * COIN))]
    tx.vout = [CTxOut(0, CScript([b'\x04', int((5 * COIN)), BEERCHAIN_MIN_GAS_PRICE, b'\x00', bytes.fromhex(contract_address), OP_CALL])) for i in range(NUM_OUTPUTS)]
    tx.rehash()
    signed_tx_hex = self.node.signrawtransactionwithwallet(bytes_to_hex_str(tx.serialize()))['hex']
    try:
        self.node.sendrawtransaction(signed_tx_hex)
    except:
        pass
    print('Tx size', len(signed_tx_hex))
    t = time.time()
    self.node.generate(1)
    execution_time = (time.time() - t)
    print('execution time:', execution_time, 'seconds')
    assert (execution_time < 60)