Files
chia-blockchain/tests/test_simulation.py
T
b964d86a5f Electron react (#226)
* clean react
* add material ui
* add word list
* mnemonic v0
* jeepney backup
* keychain usage
* wallet api
* mnemonic ui
* mnemonics redux state
* handle exceptions correctly
* dashboard
* wallets
* get puzzle hash
* tx history
* sidebar
* start stop wallet node
* use existing mnemonics
* status info
* create cc wallet
* theme should be outside of switch
* create offer
* dbus alternative for linux
* key migration
* don't autocomplete, don't reset simulator db
* reset mnemonics
* Refactor keychain, and key migration
* Implement UI for changing keys
* Removing keys and mnemonic button
* Start making farmer and harvester RPCs
* start rpx for simulator
* Harvester and farmer websocket, and basic UI
* Plot display and deletion
* launch daemon on start
* State changes from full node, harvester, farmer, and full node ui improvements
* split balances in react
* pending change balance
* plotter
* dev config
* maintain connection / retry
* Remove electron-ui, and style fixes
* Better farmer and full node control
* Remove electron ui references
* Uncomment out starting the dameon
* Remove timelord tab, and change full node style
* Clean up new wallet login
* Refactor RPCs
* Now that the GH runner uses python 3.7.7 - use for windows installer
* add balance split to coloured coin wallet
* spendable balance fix
* Import private key from UI fix
* mac build/installer

Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Lipa Long <lipa@chia.net>
Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
2020-06-01 08:56:59 -07:00

39 lines
1.1 KiB
Python

import asyncio
import pytest
import time
from typing import Dict, Any
from tests.setup_nodes import setup_full_system
from tests.block_tools import BlockTools
from src.consensus.constants import constants as consensus_constants
bt = BlockTools()
test_constants: Dict[str, Any] = consensus_constants.copy()
test_constants.update({"DIFFICULTY_STARTING": 500, "MIN_ITERS_STARTING": 500})
test_constants["GENESIS_BLOCK"] = bytes(
bt.create_genesis_block(test_constants, bytes([0] * 32), b"0")
)
@pytest.fixture(scope="module")
def event_loop():
loop = asyncio.get_event_loop()
yield loop
class TestSimulation:
@pytest.fixture(scope="function")
async def simulation(self):
async for _ in setup_full_system(test_constants):
yield _
@pytest.mark.asyncio
async def test_simulation_1(self, simulation):
node1, node2, _, _, _, _, _ = simulation
start = time.time()
while time.time() - start < 500:
if max([h.height for h in node1.blockchain.get_current_tips()]) > 10:
return
await asyncio.sleep(1)
raise Exception("Failed due to timeout")