From 441c255eba27dfa73895f38d84df1fab15b39721 Mon Sep 17 00:00:00 2001 From: Gabriel Levcovitz Date: Thu, 15 Jun 2023 12:21:39 -0300 Subject: [PATCH] tests(events): migrate flaky event simulation tests to new format --- hathor/simulator/miner/dummy_miner.py | 73 --- hathor/simulator/simulator.py | 4 - tests/event/event_simulation_tester.py | 3 +- .../event/test_event_simulation_scenarios.py | 308 +++++++++++++ tests/event/test_simulation.py | 427 ------------------ 5 files changed, 310 insertions(+), 505 deletions(-) delete mode 100644 hathor/simulator/miner/dummy_miner.py create mode 100644 tests/event/test_event_simulation_scenarios.py delete mode 100644 tests/event/test_simulation.py diff --git a/hathor/simulator/miner/dummy_miner.py b/hathor/simulator/miner/dummy_miner.py deleted file mode 100644 index a2bdd67de5..0000000000 --- a/hathor/simulator/miner/dummy_miner.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2023 Hathor Labs -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from structlog import get_logger - -from hathor.conf import HathorSettings -from hathor.manager import HathorEvents, HathorManager -from hathor.pubsub import EventArguments -from hathor.simulator.miner.abstract_miner import AbstractMiner -from hathor.transaction import Block -from hathor.util import Random - -settings = HathorSettings() -logger = get_logger() - - -class DummyMiner(AbstractMiner): - """Simulate blocks mined at pre-determined times.""" - - _start_time: int - blocks: list[Block] = [] - - def __init__(self, manager: HathorManager, rng: Random, *, block_times: list[int]): - """ - Creates a DummyMiner where each block will be generated at the times specified in block_times, in absolute - seconds from the manager's clock. - - For example, block_times=[1, 2, 3] would generate blocks at seconds 1, 2, and 3 (assuming the miner was started - before the simulator). - """ - super().__init__(manager, rng) - - self._block_times: list[int] = block_times - - def start(self) -> None: - self._start_time = int(self._clock.seconds()) - super().start() - - def get_blocks_found(self) -> int: - return len(self.blocks) - - def _on_new_tx(self, key: HathorEvents, args: EventArguments) -> None: - # DummyMiner currently doesn't support receiving new transactions and ignores them. - pass - - def _schedule_next_block(self): - if not self._block_times: - return - - next_block_time = self._start_time + self._block_times[0] - - if self._clock.seconds() >= next_block_time: - time = self._block_times.pop(0) - block = self._manager.generate_mining_block() - block.nonce = self._rng.getrandbits(32) - block.update_hash() - - self.log.debug('new pre-determined block', hash=block.hash_hex, nonce=block.nonce, time=time) - self._manager.propagate_tx(block, fails_silently=False) - self.blocks.append(block) - - self.delayed_call = self._clock.callLater(1, self._schedule_next_block) diff --git a/hathor/simulator/simulator.py b/hathor/simulator/simulator.py index 878a5d2bea..7dbb13280e 100644 --- a/hathor/simulator/simulator.py +++ b/hathor/simulator/simulator.py @@ -25,7 +25,6 @@ from hathor.daa import TestMode, _set_test_mode from hathor.manager import HathorManager from hathor.simulator.clock import HeapClock -from hathor.simulator.miner.dummy_miner import DummyMiner from hathor.simulator.miner.geometric_miner import GeometricMiner from hathor.simulator.tx_generator import RandomTransactionGenerator from hathor.transaction.genesis import _get_genesis_transactions_unsafe @@ -193,9 +192,6 @@ def create_tx_generator(self, peer: HathorManager, *args: Any, **kwargs: Any) -> def create_miner(self, peer: HathorManager, *args: Any, **kwargs: Any) -> GeometricMiner: return GeometricMiner(peer, self.rng, *args, **kwargs) - def create_dummy_miner(self, peer: HathorManager, *args: Any, **kwargs: Any) -> DummyMiner: - return DummyMiner(peer, self.rng, *args, **kwargs) - def run_to_completion(self): """ This will advance the test's clock until all calls scheduled are done. """ diff --git a/tests/event/event_simulation_tester.py b/tests/event/event_simulation_tester.py index 31d3c0c11e..338a90241e 100644 --- a/tests/event/event_simulation_tester.py +++ b/tests/event/event_simulation_tester.py @@ -40,7 +40,8 @@ def _create_artifacts(self) -> None: .enable_event_queue() artifacts = self.simulator.create_artifacts(builder) - self.peer_id = peer_id.id + assert peer_id.id is not None + self.peer_id: str = peer_id.id self.manager = artifacts.manager self.manager.allow_mining_without_peers() self.settings = artifacts.settings diff --git a/tests/event/test_event_simulation_scenarios.py b/tests/event/test_event_simulation_scenarios.py new file mode 100644 index 0000000000..53784e7916 --- /dev/null +++ b/tests/event/test_event_simulation_scenarios.py @@ -0,0 +1,308 @@ +# Copyright 2023 Hathor Labs +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from hathor.event.model.base_event import BaseEvent +from hathor.event.model.event_data import EmptyData, ReorgData, SpentOutput, TxData, TxInput, TxMetadata, TxOutput +from hathor.event.model.event_type import EventType +from hathor.event.websocket.request import StartStreamRequest +from hathor.event.websocket.response import EventResponse +from hathor.p2p.peer_id import PeerId +from hathor.simulator import FakeConnection +from hathor.simulator.trigger import StopAfterNMinedBlocks, StopAfterNTransactions +from tests.event.event_simulation_tester import ( + BaseEventSimulationTester, + MemoryEventSimulationTester, + RocksDBEventSimulationTester, +) +from tests.utils import zip_chunkify + + +class BaseEventSimulationScenariosTest(BaseEventSimulationTester): + """ + NOTE: The lists of expected events used in tests below were generated by printing the event responses list to the + console and then copying the output and manipulating it to create instances. + """ + + seed_config = 6946502462188444706 + + def test_only_load(self) -> None: + start_stream = StartStreamRequest(type='START_STREAM', window_size=1_000_000, last_ack_event_id=None) + self._send_request(start_stream) + self.simulator.run(3600) + + responses = self._get_success_responses() + + expected = [ + # LOAD_STATED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=0, timestamp=1578878880.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), latest_event_id=4), # noqa: E501 + # One NEW_VERTEX_ACCEPTED for each genesis (1 block and 2 txs) + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=1, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=4), # noqa: E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=2, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=4), # noqa: E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=3, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=4), # noqa: E501 + # LOAD_FINISHED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=4, timestamp=1578878880.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), latest_event_id=4) # noqa: E501 + ] + + assert responses == expected + + def test_single_chain_one_block(self): + miner = self.simulator.create_miner(self.manager, hashpower=1e6) + miner.start() + + trigger = StopAfterNMinedBlocks(miner, quantity=1) + self.simulator.run(3600, trigger=trigger) + miner.stop() + + start_stream = StartStreamRequest(type='START_STREAM', window_size=1_000_000, last_ack_event_id=None) + self._send_request(start_stream) + self.simulator.run(3600) + + responses = self._get_success_responses() + + expected = [ + [ + # LOAD_STATED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=0, timestamp=1578878880.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), latest_event_id=8), # noqa E501 + # One NEW_VERTEX_ACCEPTED for each genesis (1 block and 2 txs) + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=1, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=2, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=3, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + # LOAD_FINISHED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=4, timestamp=1578878880.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), latest_event_id=8), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new block (below), and one VERTEX_METADATA_CHANGED for each genesis tx (2), adding the new block as their child # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=7, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360'], twins=[], accumulated_weight=2.0, score=2.0, first_block='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=5, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360'], twins=[], accumulated_weight=2.0, score=2.0, first_block='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=6, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', nonce=105631935, timestamp=1578878910, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=8), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new block + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=8, timestamp=1578878910.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', nonce=105631935, timestamp=1578878910, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=8) # noqa E501 + ] + ] + + _assert_equal_events(responses, expected) + + def test_single_chain_blocks_and_transactions(self): + miner = self.simulator.create_miner(self.manager, hashpower=1e6) + tx_gen = self.simulator.create_tx_generator(self.manager, rate=3 / 60, hashpower=1e6, ignore_no_funds=True) + + miner_trigger = StopAfterNMinedBlocks(miner, quantity=11) + miner.start() + self.simulator.run(3600, trigger=miner_trigger) + miner.stop() + + tx_trigger = StopAfterNTransactions(tx_gen, quantity=2) + tx_gen.start() + self.simulator.run(3600, trigger=tx_trigger) + tx_gen.stop() + + miner_trigger = StopAfterNMinedBlocks(miner, quantity=1) + miner.start() + self.simulator.run(3600, trigger=miner_trigger) + miner.stop() + + self.simulator.run(3600) + start_stream = StartStreamRequest(type='START_STREAM', window_size=1_000_000, last_ack_event_id=None) + self._send_request(start_stream) + self.simulator.run(3600) + + responses = self._get_success_responses() + + expected = [ + [ + # LOAD_STATED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=0, timestamp=1578878880.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), latest_event_id=36), # noqa E501 + # One NEW_VERTEX_ACCEPTED for each genesis (1 block and 2 txs) + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=1, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=2, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=3, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + # LOAD_FINISHED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=4, timestamp=1578878880.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), latest_event_id=36), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new block (below), and one VERTEX_METADATA_CHANGED for each genesis tx (2), adding the new block as their child # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=5, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360'], twins=[], accumulated_weight=2.0, score=2.0, first_block='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=6, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360'], twins=[], accumulated_weight=2.0, score=2.0, first_block='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=7, timestamp=1578878910.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', nonce=105631935, timestamp=1578878910, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new block + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=8, timestamp=1578878910.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', nonce=105631935, timestamp=1578878910, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + # One VERTEX_METADATA_CHANGED and one NEW_VERTEX_ACCEPTED for 10 new blocks + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=9, timestamp=1578878910.5, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', nonce=1279407725, timestamp=1578878911, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUXRFxfhIYOXURHjiAlx9XPuMh7E2IrA==', token_data=0)], parents=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=10, timestamp=1578878910.5, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', nonce=1279407725, timestamp=1578878911, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUXRFxfhIYOXURHjiAlx9XPuMh7E2IrA==', token_data=0)], parents=['53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=11, timestamp=1578878910.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', nonce=1529920189, timestamp=1578878912, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUu9S/kjy3HbglEu3bA4JargdORiiIrA==', token_data=0)], parents=['967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=12, timestamp=1578878910.75, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', nonce=1529920189, timestamp=1578878912, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUu9S/kjy3HbglEu3bA4JargdORiiIrA==', token_data=0)], parents=['967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=13, timestamp=1578878911.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', nonce=1828786391, timestamp=1578878913, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzskI6jayLvTobJDhpVZiuMu7zt+IrA==', token_data=0)], parents=['68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=14, timestamp=1578878911.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', nonce=1828786391, timestamp=1578878913, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzskI6jayLvTobJDhpVZiuMu7zt+IrA==', token_data=0)], parents=['68585cc41a0cc261e97e5cf9d035e4950a9897b9fba18cbec194824522c03c7b', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=15, timestamp=1578878911.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', nonce=1915673046, timestamp=1578878914, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7B7Cf/pnj2DglfhnqyiRzxNg+K2IrA==', token_data=0)], parents=['0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=16, timestamp=1578878911.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', nonce=1915673046, timestamp=1578878914, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7B7Cf/pnj2DglfhnqyiRzxNg+K2IrA==', token_data=0)], parents=['0ed0c5540b258485199d1938646bcf10fc3b086da1110af41806c6d0792f413e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=17, timestamp=1578878911.5, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', nonce=1279525218, timestamp=1578878915, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUZmTJ0of2Ce9iuycIVpFCVU08WmKIrA==', token_data=0)], parents=['79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=18, timestamp=1578878911.5, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', nonce=1279525218, timestamp=1578878915, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUZmTJ0of2Ce9iuycIVpFCVU08WmKIrA==', token_data=0)], parents=['79c4da1aa12adbb3e384f3e631cf0f8898922db6a7a157c878d6dd5d27b62e77', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=19, timestamp=1578878911.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', nonce=4136633663, timestamp=1578878916, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPNN8M/qangqd2wYSzu0u+3OmwDmIrA==', token_data=0)], parents=['0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=20, timestamp=1578878911.75, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', nonce=4136633663, timestamp=1578878916, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPNN8M/qangqd2wYSzu0u+3OmwDmIrA==', token_data=0)], parents=['0c88949d8b9eef81bf0896aabe875c4bd1172bc834b7bc4cc1c756a3d243ec52', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=21, timestamp=1578878912.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', nonce=945260546, timestamp=1578878917, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUxbNqvpWbgNtk9km/VuYhzHHMp76IrA==', token_data=0)], parents=['3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=22, timestamp=1578878912.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', nonce=945260546, timestamp=1578878917, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUxbNqvpWbgNtk9km/VuYhzHHMp76IrA==', token_data=0)], parents=['3624a05261b604d4ff46b0157892b2ff48a7fb1e31fe65e58fbbfe88cadcbdd4', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=23, timestamp=1578878912.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', nonce=2222918728, timestamp=1578878918, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU48C0XcFpiaWq2gwTICyEVdvJXcCIrA==', token_data=0)], parents=['282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=24, timestamp=1578878912.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', nonce=2222918728, timestamp=1578878918, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU48C0XcFpiaWq2gwTICyEVdvJXcCIrA==', token_data=0)], parents=['282d65827ecc485b1c8b916f71605da0f15f353325feb9a1a87fe320c1ebc915', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=25, timestamp=1578878912.5, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', nonce=3090209358, timestamp=1578878919, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUmQRjqRyxq26raJZnhnpRJsrS9n2IrA==', token_data=0)], parents=['4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=26, timestamp=1578878912.5, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', nonce=3090209358, timestamp=1578878919, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUmQRjqRyxq26raJZnhnpRJsrS9n2IrA==', token_data=0)], parents=['4978ebbeb98dccae64f3d32269e1a1030892c82b023448cafd649cad73e9127a', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=27, timestamp=1578878912.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', nonce=3024981275, timestamp=1578878920, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUYFHjcujZZHs0JWZkriEbn5jTv/aIrA==', token_data=0)], parents=['47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=28, timestamp=1578878912.75, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', nonce=3024981275, timestamp=1578878920, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUYFHjcujZZHs0JWZkriEbn5jTv/aIrA==', token_data=0)], parents=['47ced60615a9d5d4fc1ca26d9dbc71ca89b8b35541b31d8e75a65d4badfa99c7', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new tx (below), and one VERTEX_METADATA_CHANGED for a block, adding the new tx as spending their output # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=30, timestamp=1578879395.5, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', nonce=105631935, timestamp=1578878910, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', spent_outputs=[SpentOutput(index=0, tx_ids=['bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c'])], conflict_with=[], voided_by=[], received_by=[], children=['967f7d6577e5b301d7facaf7fecd87f18586acfd24fc52e49251c9c4195b49f6'], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=29, timestamp=1578879395.5, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', nonce=0, timestamp=1578879395, version=1, weight=18.648830153779993, inputs=[TxInput(tx_id='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', index=0, data='RjBEAiBQAVgs/jYpndowN3/JMI07fM886ergyyGA2xXaHCu5BQIgf58pdc8S9ABgzkUx8qDQUtV3FcYCMMzHs90q36L0J+whA0zN7LEgxcswPkHbbW7mdnkS5yviaZFgjID1mhpSZSQf')], outputs=[TxOutput(value=2132, script='dqkUutgaVG8W5OnzgAEVUqB4XgmDgm2IrA==', token_data=0), TxOutput(value=4268, script='dqkUBvl1aaAtzoh8a9vaZoqXA6JxK4OIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=18.648830153779993, score=0.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new tx + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=31, timestamp=1578879395.5, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', nonce=0, timestamp=1578879395, version=1, weight=18.648830153779993, inputs=[TxInput(tx_id='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', index=0, data='RjBEAiBQAVgs/jYpndowN3/JMI07fM886ergyyGA2xXaHCu5BQIgf58pdc8S9ABgzkUx8qDQUtV3FcYCMMzHs90q36L0J+whA0zN7LEgxcswPkHbbW7mdnkS5yviaZFgjID1mhpSZSQf')], outputs=[TxOutput(value=2132, script='dqkUutgaVG8W5OnzgAEVUqB4XgmDgm2IrA==', token_data=0), TxOutput(value=4268, script='dqkUBvl1aaAtzoh8a9vaZoqXA6JxK4OIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=18.648830153779993, score=0.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new tx (below), and one VERTEX_METADATA_CHANGED for a block, adding the new tx as spending their output # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=32, timestamp=1578879429.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', nonce=0, timestamp=1578879395, version=1, weight=18.648830153779993, inputs=[TxInput(tx_id='53c5fe57a6d79ab4a8eca660bd0a9935fe9f82d2506d80e0c48339c42c234360', index=0, data='RjBEAiBQAVgs/jYpndowN3/JMI07fM886ergyyGA2xXaHCu5BQIgf58pdc8S9ABgzkUx8qDQUtV3FcYCMMzHs90q36L0J+whA0zN7LEgxcswPkHbbW7mdnkS5yviaZFgjID1mhpSZSQf')], outputs=[TxOutput(value=2132, script='dqkUutgaVG8W5OnzgAEVUqB4XgmDgm2IrA==', token_data=0), TxOutput(value=4268, script='dqkUBvl1aaAtzoh8a9vaZoqXA6JxK4OIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', spent_outputs=[SpentOutput(index=0, tx_ids=['47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea']), SpentOutput(index=1, tx_ids=['47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea'])], conflict_with=[], voided_by=[], received_by=[], children=['47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea'], twins=[], accumulated_weight=18.648830153779993, score=0.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=33, timestamp=1578879429.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea', nonce=0, timestamp=1578879423, version=1, weight=19.563446104298656, inputs=[TxInput(tx_id='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', index=0, data='RzBFAiANP0tUHsWIPFnkwG0Io7W53viGaXgWfyniIsyJHIva7AIhAIij02z4JPki4RT5b/UkJoKVgazA7QWIq1Zwvik2xhXZIQOnBXShvpioJZgNxYy4lgCg4o84Uw9ncOQuv9mxPWEqeg=='), TxInput(tx_id='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', index=1, data='RjBEAiAj6I8PifTvE1J7eAqxHLu2YqFThzc4C4YzIzq+aX1fBQIgdH+xu08lWjdGiRjuaYgf/S9EZYw8U1HJQ2//WtERx9chA9euCC5MDnVV3I2e5yKj1Q65BsqgN2+IwojZqatIF3T8')], outputs=[TxOutput(value=2764, script='dqkUmkey79Rbhjq4BtHYCm2mT8hDprWIrA==', token_data=0), TxOutput(value=3636, script='dqkUFgE9a6rVMusN303z18sYfjdpYGqIrA==', token_data=0)], parents=['bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=19.563446104298656, score=0.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new tx + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=34, timestamp=1578879429.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea', nonce=0, timestamp=1578879423, version=1, weight=19.563446104298656, inputs=[TxInput(tx_id='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', index=0, data='RzBFAiANP0tUHsWIPFnkwG0Io7W53viGaXgWfyniIsyJHIva7AIhAIij02z4JPki4RT5b/UkJoKVgazA7QWIq1Zwvik2xhXZIQOnBXShvpioJZgNxYy4lgCg4o84Uw9ncOQuv9mxPWEqeg=='), TxInput(tx_id='bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', index=1, data='RjBEAiAj6I8PifTvE1J7eAqxHLu2YqFThzc4C4YzIzq+aX1fBQIgdH+xu08lWjdGiRjuaYgf/S9EZYw8U1HJQ2//WtERx9chA9euCC5MDnVV3I2e5yKj1Q65BsqgN2+IwojZqatIF3T8')], outputs=[TxOutput(value=2764, script='dqkUmkey79Rbhjq4BtHYCm2mT8hDprWIrA==', token_data=0), TxOutput(value=3636, script='dqkUFgE9a6rVMusN303z18sYfjdpYGqIrA==', token_data=0)], parents=['bd1c5ae097470eecfe10b3f25e02c0f8358b95706484b2174c6ea0ff930cc25c', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='47b26240891fb57320d72cbd708f5287ca056e73f4b19bb295e6b19d984c07ea', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=19.563446104298656, score=0.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + ], + [ + # One VERTEX_METADATA_CHANGED and one NEW_VERTEX_ACCEPTED for a new block + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=35, timestamp=1578879429.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='f2d1327e556ac534e0d934c4e884af3ffe5ecdfd7c5045e30a123a8171500990', nonce=2907562093, timestamp=1578878921, version=0, weight=8.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUBvl1aaAtzoh8a9vaZoqXA6JxK4OIrA==', token_data=0)], parents=['15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f2d1327e556ac534e0d934c4e884af3ffe5ecdfd7c5045e30a123a8171500990', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=8.0, score=8.285402218862249, first_block=None, height=12, validation='full'), aux_pow=None), group_id=None), latest_event_id=36), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=36, timestamp=1578879429.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='f2d1327e556ac534e0d934c4e884af3ffe5ecdfd7c5045e30a123a8171500990', nonce=2907562093, timestamp=1578878921, version=0, weight=8.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUBvl1aaAtzoh8a9vaZoqXA6JxK4OIrA==', token_data=0)], parents=['15599c25cb30892add963558e06c97c2a838a8a5c047aee416dc9a3617d59baa', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f2d1327e556ac534e0d934c4e884af3ffe5ecdfd7c5045e30a123a8171500990', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=8.0, score=8.285402218862249, first_block=None, height=12, validation='full'), aux_pow=None), group_id=None), latest_event_id=36) # noqa E501 + ] + ] + + _assert_equal_events(responses, expected) + + def test_reorg(self): + miner1 = self.simulator.create_miner(self.manager, hashpower=1e6) + + builder = self.simulator.get_default_builder().set_peer_id(PeerId()) + manager2 = self.simulator.create_peer(builder) + manager2.allow_mining_without_peers() + + miner2 = self.simulator.create_miner(manager2, hashpower=1e6) + + connection = FakeConnection(self.manager, manager2, latency=1) + self.simulator.add_connection(connection) + + trigger1 = StopAfterNMinedBlocks(miner1, quantity=1) + miner1.start() + self.simulator.run(3600, trigger=trigger1) + miner1.stop() + + trigger2 = StopAfterNMinedBlocks(miner2, quantity=2) + miner2.start() + self.simulator.run(3600, trigger=trigger2) + miner2.stop() + + self.simulator.run(3600) + start_stream = StartStreamRequest(type='START_STREAM', window_size=1_000_000, last_ack_event_id=None) + self._send_request(start_stream) + self.simulator.run(3600) + + responses = self._get_success_responses() + + expected = [ + [ + # LOAD_STATED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=0, timestamp=1578878880.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), latest_event_id=20), # noqa E501 + # One NEW_VERTEX_ACCEPTED for each genesis (1 block and 2 txs) + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=1, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=2, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=3, timestamp=1578878880.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + # LOAD_FINISHED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=4, timestamp=1578878880.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), latest_event_id=20), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new block (below), and one VERTEX_METADATA_CHANGED for each genesis tx (2), adding the new block as their child # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=5, timestamp=1578878940.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3'], twins=[], accumulated_weight=2.0, score=2.0, first_block='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=7, timestamp=1578878940.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3'], twins=[], accumulated_weight=2.0, score=2.0, first_block='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=6, timestamp=1578878940.25, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', nonce=2246536493, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new block from manager1 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=8, timestamp=1578878940.25, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', nonce=2246536493, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new block (below), and one VERTEX_METADATA_CHANGED for each genesis tx (2), adding the new block as their child # noqa E501 + # Also one VERTEX_METADATA_CHANGED for the previous block, voiding it + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=9, timestamp=1578878955.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', '4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7'], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=12, timestamp=1578878955.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', '4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7'], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=11, timestamp=1578878955.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', nonce=2246536493, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUPXOcGnrN0ZB2WrnPVcjdCCcacL+IrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', spent_outputs=[], conflict_with=[], voided_by=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3'], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=10, timestamp=1578878955.75, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', nonce=1279525218, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUfBo1MGBHkHtXDktO+BxtBdh5T5GIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', spent_outputs=[], conflict_with=[], voided_by=['4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7'], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + ]), + [ + # One NEW_VERTEX_ACCEPTED for a new block from manager2 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=13, timestamp=1578878955.75, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', nonce=1279525218, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUfBo1MGBHkHtXDktO+BxtBdh5T5GIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', spent_outputs=[], conflict_with=[], voided_by=['4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7'], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=None), latest_event_id=20), # noqa E501 + # REORG_STARTED caused by a new block from manager2 (below) + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=14, timestamp=1578878956.0, type=EventType.REORG_STARTED, data=ReorgData(reorg_size=1, previous_best_block='3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', new_best_block='a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4', common_block='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792'), group_id=0), latest_event_id=20), # noqa E501 + ], + UnorderedList([ + # One VERTEX_METADATA_CHANGED for a new block (below), and one VERTEX_METADATA_CHANGED for each genesis tx (2), adding the new block as their child # noqa E501 + # Also one VERTEX_METADATA_CHANGED for the previous block, un-voiding it as it's now part of the best blockchain # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=15, timestamp=1578878956.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', '4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', 'a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4'], twins=[], accumulated_weight=2.0, score=2.0, first_block='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', height=0, validation='full'), aux_pow=None), group_id=0), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=18, timestamp=1578878956.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['3cfde60f140d2838581d885e656af1049fa8eab964defc5bca3d883b83c9afc3', '4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', 'a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4'], twins=[], accumulated_weight=2.0, score=2.0, first_block='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', height=0, validation='full'), aux_pow=None), group_id=0), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=17, timestamp=1578878956.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', nonce=1279525218, timestamp=1578878940, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUfBo1MGBHkHtXDktO+BxtBdh5T5GIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4'], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full'), aux_pow=None), group_id=0), latest_event_id=20), # noqa E501 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=16, timestamp=1578878956.0, type=EventType.VERTEX_METADATA_CHANGED, data=TxData(hash='a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4', nonce=4136633663, timestamp=1578878941, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUgQrqLefPfPVpkXlfvvAp943epyOIrA==', token_data=0)], parents=['4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full'), aux_pow=None), group_id=0), latest_event_id=20), # noqa E501 + ]), + [ + # REORG_FINISHED + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=19, timestamp=1578878956.0, type=EventType.REORG_FINISHED, data=EmptyData(), group_id=0), latest_event_id=20), # noqa E501 + # One NEW_VERTEX_ACCEPTED for a new block from manager2 + EventResponse(type='EVENT', event=BaseEvent(peer_id=self.peer_id, id=20, timestamp=1578878956.0, type=EventType.NEW_VERTEX_ACCEPTED, data=TxData(hash='a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4', nonce=4136633663, timestamp=1578878941, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUgQrqLefPfPVpkXlfvvAp943epyOIrA==', token_data=0)], parents=['4f0b3d13966f95f461d4edc6389c8440955e13a75f87c6bc2a4b455d813fb2f7', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='a729a7abb4248dffa492dd2c2634aa6d92b3e1e05bfa6614118b6ba97bfba5c4', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full'), aux_pow=None), group_id=None), latest_event_id=20) # noqa E501 + ] + ] + + _assert_equal_events(responses, expected) + + +class UnorderedList(list): + pass + + +def _assert_equal_events(actual_events: list[EventResponse], expected_events: list[list[EventResponse]]) -> None: + for actual_events_chunk, expected_events_chunk in zip_chunkify(actual_events, expected_events): + if isinstance(expected_events_chunk, UnorderedList): + actual_events_chunk = _sorted_by_hash_without_id(actual_events_chunk) + expected_events_chunk = _sorted_by_hash_without_id(expected_events_chunk) + + assert expected_events_chunk == actual_events_chunk, ( + f'different chunks:\n\nexpected: {expected_events_chunk}\n\nactual: {actual_events_chunk}\n' + ) + + +def _sorted_by_hash_without_id(responses: list[EventResponse]) -> list[EventResponse]: + responses_without_id = [response.copy(exclude={'event': {'id'}}) for response in responses] + + def key(response: EventResponse) -> str: + assert isinstance(response.event.data, TxData), ( + f'only tx events can be sorted. event.data type: {type(response.event.data)}' + ) + return response.event.data.hash + + return sorted(responses_without_id, key=key) + + +class MemoryEventSimulationScenariosTest(BaseEventSimulationScenariosTest, MemoryEventSimulationTester): + __test__ = True + + +class RocksDBEventSimulationScenariosTest(BaseEventSimulationScenariosTest, RocksDBEventSimulationTester): + __test__ = True diff --git a/tests/event/test_simulation.py b/tests/event/test_simulation.py deleted file mode 100644 index 14e67bbb44..0000000000 --- a/tests/event/test_simulation.py +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright 2023 Hathor Labs -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import pytest - -from hathor.event.model.base_event import BaseEvent -from hathor.event.model.event_data import EmptyData, ReorgData, SpentOutput, TxData, TxInput, TxMetadata, TxOutput -from hathor.event.model.event_type import EventType -from hathor.p2p.peer_id import PeerId -from hathor.simulator import Simulator -from tests.unittest import TestCase -from tests.utils import zip_chunkify - -SIMULATOR_SEED = 9922163193306864793 - - -class TestEventSimulation(TestCase): - """ - NOTE: The lists of expected events used in tests below were generated by using print() in a loop for each event, - and then copying the output and manipulating it to create instances. - """ - def test_only_load(self): - simulator = Simulator(seed=SIMULATOR_SEED) - simulator.start() - - main_peer_id = PeerId() - builder = simulator.get_default_builder() \ - .set_peer_id(main_peer_id) \ - .disable_full_verification() \ - .enable_event_queue() - main_manager = simulator.create_peer(builder) - main_manager.allow_mining_without_peers() - - simulator.run(2 * 60) - simulator.stop() - - actual_event_iterator = main_manager._event_manager.event_storage.iter_from_event(0) - actual_events = list(actual_event_iterator) - - expected_events = [ - [ - BaseEvent( - peer_id=main_peer_id.id, - id=0, - timestamp=1572653259, - type=EventType.LOAD_STARTED, - data=EmptyData() - ), - ], - UnorderedEventList([ - BaseEvent( - peer_id=main_peer_id.id, - id=1, - timestamp=1572653259, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=2, - timestamp=1572653259.0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=3, - timestamp=1572653259.0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - ]), - [ - BaseEvent( - peer_id=main_peer_id.id, - id=4, - timestamp=1572653259, - type=EventType.LOAD_FINISHED, - data=EmptyData() - ), - ] - ] - - _assert_equal_events(actual_events, expected_events) - - def test_single_chain_one_block(self): - simulator = Simulator(seed=SIMULATOR_SEED) - simulator.start() - - main_peer_id = PeerId() - builder = simulator.get_default_builder() \ - .set_peer_id(main_peer_id) \ - .disable_full_verification() \ - .enable_event_queue() - main_manager = simulator.create_peer(builder) - main_manager.allow_mining_without_peers() - - miner = simulator.create_dummy_miner(main_manager, block_times=[120]) - miner.start() - - simulator.run(2 * 60) - simulator.stop() - - actual_event_iterator = main_manager._event_manager.event_storage.iter_from_event(0) - actual_events = list(actual_event_iterator) - - expected_events = [ - [ - BaseEvent( - peer_id=main_peer_id.id, - id=0, - timestamp=1572653259, - type=EventType.LOAD_STARTED, - data=EmptyData() - ), - ], - UnorderedEventList([ - BaseEvent( - peer_id=main_peer_id.id, - id=1, - timestamp=1572653259, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=2, - timestamp=1572653259.0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=3, - timestamp=1572653259.0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')) # noqa: E501 - ), - ]), - [ - BaseEvent( - peer_id=main_peer_id.id, - id=4, - timestamp=1572653259, - type=EventType.LOAD_FINISHED, - data=EmptyData() - ) - ], - UnorderedEventList([ - BaseEvent( - peer_id=main_peer_id.id, - id=5, - timestamp=1572653409.0, - type=EventType.VERTEX_METADATA_CHANGED, - data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8'], twins=[], accumulated_weight=2.0, score=2.0, first_block='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', height=0, validation='full')), # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=6, - timestamp=1572653409.0, - type=EventType.VERTEX_METADATA_CHANGED, - data=TxData(hash='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', nonce=3849224008, timestamp=1572653409, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), # noqa: E501 - ), - BaseEvent( - peer_id=main_peer_id.id, - id=7, - timestamp=1572653409.0, - type=EventType.VERTEX_METADATA_CHANGED, - data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8'], twins=[], accumulated_weight=2.0, score=2.0, first_block='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', height=0, validation='full')), # noqa: E501 - ) - ]), - [ - BaseEvent( - peer_id=main_peer_id.id, - id=8, - timestamp=1572653409.0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=TxData(hash='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', nonce=3849224008, timestamp=1572653409, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c7316accecf14910349ee06dbc265d7daa87cfb65c36b317f0985cb75ec71de8', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), # noqa: E501 - ) - ] - ] - - _assert_equal_events(actual_events, expected_events) - - @pytest.mark.skip(reason='broken?') - def test_single_chain_blocks_and_transactions(self): - simulator = Simulator(seed=SIMULATOR_SEED) - simulator.start() - - main_peer_id = PeerId() - builder = simulator.get_default_builder() \ - .set_peer_id(main_peer_id) \ - .disable_full_verification() \ - .enable_event_queue() - main_manager = simulator.create_peer(builder) - main_manager.allow_mining_without_peers() - - miner = simulator.create_dummy_miner(main_manager, block_times=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 120]) - miner.start() - - tx_gen = simulator.create_tx_generator(main_manager, rate=0.2, hashpower=1e12, ignore_no_funds=True) - tx_gen.start() - - simulator.run(2 * 60) - simulator.stop() - - actual_event_iterator = main_manager._event_manager.event_storage.iter_from_event(0) - actual_events = list(actual_event_iterator) - - expected_events = [ - [ - BaseEvent(peer_id=main_peer_id.id, id=0, timestamp=1572653259.0, type='LOAD_STARTED', data=EmptyData(), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=1, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=2, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=3, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=4, timestamp=1572653259.0, type='LOAD_FINISHED', data=EmptyData(), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=5, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=7, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=6, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', nonce=3849224008, timestamp=1572653289, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=8, timestamp=1572653289.25, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', nonce=3849224008, timestamp=1572653289, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=9, timestamp=1572653290.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', nonce=2571046484, timestamp=1572653290, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7TohZ0qkDwOGVvk902Ee5ocSLjiIrA==', token_data=0)], parents=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=10, timestamp=1572653290.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', nonce=2571046484, timestamp=1572653290, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7TohZ0qkDwOGVvk902Ee5ocSLjiIrA==', token_data=0)], parents=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=11, timestamp=1572653291.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', nonce=2810868913, timestamp=1572653291, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUJ1IwZftpI4amogcnKJWgc6/eJWuIrA==', token_data=0)], parents=['6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=12, timestamp=1572653291.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', nonce=2810868913, timestamp=1572653291, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUJ1IwZftpI4amogcnKJWgc6/eJWuIrA==', token_data=0)], parents=['6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=13, timestamp=1572653292.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', nonce=2900453906, timestamp=1572653292, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUA6/mkfdCoE0/VMGDn4pFDLOkJF6IrA==', token_data=0)], parents=['34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=14, timestamp=1572653292.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', nonce=2900453906, timestamp=1572653292, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUA6/mkfdCoE0/VMGDn4pFDLOkJF6IrA==', token_data=0)], parents=['34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=15, timestamp=1572653293.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', nonce=71421764, timestamp=1572653293, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU+Rx7PbRe12ascscuo5C+ebnqXESIrA==', token_data=0)], parents=['4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=16, timestamp=1572653293.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', nonce=71421764, timestamp=1572653293, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU+Rx7PbRe12ascscuo5C+ebnqXESIrA==', token_data=0)], parents=['4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=17, timestamp=1572653294.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', nonce=2877639466, timestamp=1572653294, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUR/OZE3YnG5JNA94GMjCapu+YyqiIrA==', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=18, timestamp=1572653294.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', nonce=2877639466, timestamp=1572653294, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUR/OZE3YnG5JNA94GMjCapu+YyqiIrA==', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=19, timestamp=1572653295.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', nonce=1254860223, timestamp=1572653295, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU2G9W3JjDgfDf92m10Y1SliEnJWSIrA==', token_data=0)], parents=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=20, timestamp=1572653295.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', nonce=1254860223, timestamp=1572653295, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU2G9W3JjDgfDf92m10Y1SliEnJWSIrA==', token_data=0)], parents=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=21, timestamp=1572653296.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', nonce=681687539, timestamp=1572653296, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzWAOeu+SS7iMOMU3PLGJWw0pzeCIrA==', token_data=0)], parents=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=22, timestamp=1572653296.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', nonce=681687539, timestamp=1572653296, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzWAOeu+SS7iMOMU3PLGJWw0pzeCIrA==', token_data=0)], parents=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=23, timestamp=1572653297.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', nonce=1629369717, timestamp=1572653297, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUSQT96vTRhrFDCpyd3UYpXzzizO2IrA==', token_data=0)], parents=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=24, timestamp=1572653297.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', nonce=1629369717, timestamp=1572653297, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUSQT96vTRhrFDCpyd3UYpXzzizO2IrA==', token_data=0)], parents=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=25, timestamp=1572653298.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', nonce=1825990282, timestamp=1572653298, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU3ME2MVjVXosrj6JwB1CUW5YpRpyIrA==', token_data=0)], parents=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=26, timestamp=1572653298.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', nonce=1825990282, timestamp=1572653298, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU3ME2MVjVXosrj6JwB1CUW5YpRpyIrA==', token_data=0)], parents=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=27, timestamp=1572653299.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', nonce=738245143, timestamp=1572653299, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUuSgyjGBpztv2JOEZEuBZ8hMWj0yIrA==', token_data=0)], parents=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=28, timestamp=1572653299.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', nonce=738245143, timestamp=1572653299, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUuSgyjGBpztv2JOEZEuBZ8hMWj0yIrA==', token_data=0)], parents=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full')), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=29, timestamp=1572653370.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', nonce=3849224008, timestamp=1572653289, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', spent_outputs=[SpentOutput(index=0, tx_ids=['f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79'])], conflict_with=[], voided_by=[], received_by=[], children=['6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1'], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=30, timestamp=1572653370.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', nonce=2, timestamp=1572653369, version=1, weight=18.664694903964126, inputs=[TxInput(tx_id='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', index=0, data='SDBGAiEAwRECSYXApimxuQ9cD88w9U0N+SdAtJZfi0x1e3VgGmYCIQDsIsEC2nZzWgIa1U+eh/pIzhMg0rKvH3u8BaRLCpz4ICEC6Y5mbQB/qe5dH40iULOaEGoGq9CKeQMumnT8+yyMIHM=')], outputs=[TxOutput(value=1431, script='dqkU91U6sMdzgT3zxOtdIVGbqobP0FmIrA==', token_data=0), TxOutput(value=4969, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=18.664694903964126, score=0.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=31, timestamp=1572653370.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', nonce=2, timestamp=1572653369, version=1, weight=18.664694903964126, inputs=[TxInput(tx_id='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', index=0, data='SDBGAiEAwRECSYXApimxuQ9cD88w9U0N+SdAtJZfi0x1e3VgGmYCIQDsIsEC2nZzWgIa1U+eh/pIzhMg0rKvH3u8BaRLCpz4ICEC6Y5mbQB/qe5dH40iULOaEGoGq9CKeQMumnT8+yyMIHM=')], outputs=[TxOutput(value=1431, script='dqkU91U6sMdzgT3zxOtdIVGbqobP0FmIrA==', token_data=0), TxOutput(value=4969, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=18.664694903964126, score=0.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=32, timestamp=1572653384.75, type='VERTEX_METADATA_CHANGED', data=TxData(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', nonce=4, timestamp=1572653384, version=1, weight=19.568795613217652, inputs=[TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=0, data='RzBFAiBYhxr1IwcaECRZ+1aBbbribFNlBwaHj6xYloRvM5GgNgIhAJEZFLLmhQu50PkbVN+ShY0Wu3nC8ovnH/0A4HPT+oM3IQJ5e3XMPtNc1G7jFBLtvi0UahT3TdEIE7Oy5aV8FTNzng=='), TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=1, data='RzBFAiBpIjqEJTn35NZ6f5K1yjKhs+JI52VaeoVYeh/KKXVCaQIhAPFpz7OuVHxAjY47dUqf30WAK/K65ESfwFcc3cq8Vx5QIQNuTU0Ido94RX5qWDgmtAgJIgBn2levBgXDiFai9kRQpg==')], outputs=[TxOutput(value=1199, script='dqkULLHzgtmv69PpRwlTBTzNGRcIE9yIrA==', token_data=0), TxOutput(value=5201, script='dqkUhLDX6YydV5HBbevVaHD+YWuBHRyIrA==', token_data=0)], parents=['f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=19.568795613217652, score=0.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=33, timestamp=1572653384.75, type='VERTEX_METADATA_CHANGED', data=TxData(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', nonce=2, timestamp=1572653369, version=1, weight=18.664694903964126, inputs=[TxInput(tx_id='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', index=0, data='SDBGAiEAwRECSYXApimxuQ9cD88w9U0N+SdAtJZfi0x1e3VgGmYCIQDsIsEC2nZzWgIa1U+eh/pIzhMg0rKvH3u8BaRLCpz4ICEC6Y5mbQB/qe5dH40iULOaEGoGq9CKeQMumnT8+yyMIHM=')], outputs=[TxOutput(value=1431, script='dqkU91U6sMdzgT3zxOtdIVGbqobP0FmIrA==', token_data=0), TxOutput(value=4969, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', spent_outputs=[SpentOutput(index=0, tx_ids=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f']), SpentOutput(index=1, tx_ids=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f'])], conflict_with=[], voided_by=[], received_by=[], children=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f'], twins=[], accumulated_weight=18.664694903964126, score=0.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=34, timestamp=1572653384.75, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', nonce=4, timestamp=1572653384, version=1, weight=19.568795613217652, inputs=[TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=0, data='RzBFAiBYhxr1IwcaECRZ+1aBbbribFNlBwaHj6xYloRvM5GgNgIhAJEZFLLmhQu50PkbVN+ShY0Wu3nC8ovnH/0A4HPT+oM3IQJ5e3XMPtNc1G7jFBLtvi0UahT3TdEIE7Oy5aV8FTNzng=='), TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=1, data='RzBFAiBpIjqEJTn35NZ6f5K1yjKhs+JI52VaeoVYeh/KKXVCaQIhAPFpz7OuVHxAjY47dUqf30WAK/K65ESfwFcc3cq8Vx5QIQNuTU0Ido94RX5qWDgmtAgJIgBn2levBgXDiFai9kRQpg==')], outputs=[TxOutput(value=1199, script='dqkULLHzgtmv69PpRwlTBTzNGRcIE9yIrA==', token_data=0), TxOutput(value=5201, script='dqkUhLDX6YydV5HBbevVaHD+YWuBHRyIrA==', token_data=0)], parents=['f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=19.568795613217652, score=0.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=35, timestamp=1572653409.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', nonce=4, timestamp=1572653384, version=1, weight=19.568795613217652, inputs=[TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=0, data='RzBFAiBYhxr1IwcaECRZ+1aBbbribFNlBwaHj6xYloRvM5GgNgIhAJEZFLLmhQu50PkbVN+ShY0Wu3nC8ovnH/0A4HPT+oM3IQJ5e3XMPtNc1G7jFBLtvi0UahT3TdEIE7Oy5aV8FTNzng=='), TxInput(tx_id='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', index=1, data='RzBFAiBpIjqEJTn35NZ6f5K1yjKhs+JI52VaeoVYeh/KKXVCaQIhAPFpz7OuVHxAjY47dUqf30WAK/K65ESfwFcc3cq8Vx5QIQNuTU0Ido94RX5qWDgmtAgJIgBn2levBgXDiFai9kRQpg==')], outputs=[TxOutput(value=1199, script='dqkULLHzgtmv69PpRwlTBTzNGRcIE9yIrA==', token_data=0), TxOutput(value=5201, script='dqkUhLDX6YydV5HBbevVaHD+YWuBHRyIrA==', token_data=0)], parents=['f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa'], twins=[], accumulated_weight=19.568795613217652, score=0.0, first_block='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=36, timestamp=1572653409.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', nonce=2, timestamp=1572653369, version=1, weight=18.664694903964126, inputs=[TxInput(tx_id='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', index=0, data='SDBGAiEAwRECSYXApimxuQ9cD88w9U0N+SdAtJZfi0x1e3VgGmYCIQDsIsEC2nZzWgIa1U+eh/pIzhMg0rKvH3u8BaRLCpz4ICEC6Y5mbQB/qe5dH40iULOaEGoGq9CKeQMumnT8+yyMIHM=')], outputs=[TxOutput(value=1431, script='dqkU91U6sMdzgT3zxOtdIVGbqobP0FmIrA==', token_data=0), TxOutput(value=4969, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79', spent_outputs=[SpentOutput(index=0, tx_ids=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f']), SpentOutput(index=1, tx_ids=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f'])], conflict_with=[], voided_by=[], received_by=[], children=['58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', '01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa'], twins=[], accumulated_weight=18.664694903964126, score=0.0, first_block='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=37, timestamp=1572653409.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', nonce=4226205465, timestamp=1572653409, version=0, weight=8.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUlAsOm11At4ng3JBW477DOP0eQtGIrA==', token_data=0)], parents=['ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', '58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', 'f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=8.0, score=20.18681516127742, first_block=None, height=12, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=38, timestamp=1572653409.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', nonce=4226205465, timestamp=1572653409, version=0, weight=8.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUlAsOm11At4ng3JBW477DOP0eQtGIrA==', token_data=0)], parents=['ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', '58fba3126e91f546fc11792637d0c4112e2de12920628f98ca1abe4fa97cc74f', 'f42fbcd1549389632236f85a80ad2dd8cac2f150501fb40b11210bad03718f79'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='01375179ce0f6a6d6501fec0ee14dba8e134372a8fe6519aa952ced7b0577aaa', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=8.0, score=20.18681516127742, first_block=None, height=12, validation='full')), group_id=None) # noqa E501 - ] - ] - - _assert_equal_events(actual_events, expected_events) - - @pytest.mark.skip(reason='broken?') - def test_reorg(self): - simulator = Simulator(seed=SIMULATOR_SEED) - simulator.start() - - main_peer_id = PeerId() - builder = simulator.get_default_builder() \ - .set_peer_id(main_peer_id) \ - .disable_full_verification() \ - .enable_event_queue() - main_manager = simulator.create_peer(builder) - main_manager.allow_mining_without_peers() - - miner = simulator.create_dummy_miner(main_manager, block_times=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 120]) - miner.start() - - tx_gen = simulator.create_tx_generator(main_manager, rate=0.2, hashpower=1e12, ignore_no_funds=True) - tx_gen.start() - - simulator.run(60) - - block_to_replace = miner.blocks[5] - reorg_block_template = main_manager.make_custom_block_template( - parent_block_hash=block_to_replace.parents[0], - parent_tx_hashes=block_to_replace.parents[1:] - ) - reorg_block = reorg_block_template.generate_mining_block(main_manager.rng, storage=main_manager.tx_storage) - reorg_block.weight = 10 - reorg_block.resolve() - reorg_block.verify() - main_manager.propagate_tx(reorg_block, fails_silently=False) - - simulator.run(60) - simulator.stop() - - actual_event_iterator = main_manager._event_manager.event_storage.iter_from_event(0) - actual_events = list(actual_event_iterator) - - expected_events = [ - [ - BaseEvent(peer_id=main_peer_id.id, id=0, timestamp=1572653259.0, type='LOAD_STARTED', data=EmptyData(), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=1, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', nonce=0, timestamp=1572636343, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=100000000000, script='dqkU/QUFm2AGJJVDuC82h2oXxz/SJnuIrA==', token_data=0)], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=2, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=3, timestamp=1572653259.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=2.0, first_block=None, height=0, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=4, timestamp=1572653259.0, type='LOAD_FINISHED', data=EmptyData(), group_id=None), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=5, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', nonce=6, timestamp=1572636344, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=7, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', nonce=2, timestamp=1572636345, version=1, weight=2.0, inputs=[], outputs=[], parents=[], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=6, timestamp=1572653289.25, type='VERTEX_METADATA_CHANGED', data=TxData(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', nonce=3849224008, timestamp=1572653289, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), group_id=None), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=8, timestamp=1572653289.25, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', nonce=3849224008, timestamp=1572653289, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUCVEmDq3zPs6KV42QQDe7R/jVSsCIrA==', token_data=0)], parents=['339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.0, first_block=None, height=1, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=9, timestamp=1572653290.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', nonce=2571046484, timestamp=1572653290, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7TohZ0qkDwOGVvk902Ee5ocSLjiIrA==', token_data=0)], parents=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=10, timestamp=1572653290.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', nonce=2571046484, timestamp=1572653290, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU7TohZ0qkDwOGVvk902Ee5ocSLjiIrA==', token_data=0)], parents=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.321928094887363, first_block=None, height=2, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=11, timestamp=1572653291.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', nonce=2810868913, timestamp=1572653291, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUJ1IwZftpI4amogcnKJWgc6/eJWuIrA==', token_data=0)], parents=['6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=12, timestamp=1572653291.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', nonce=2810868913, timestamp=1572653291, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUJ1IwZftpI4amogcnKJWgc6/eJWuIrA==', token_data=0)], parents=['6c4babf9e8fcda5c2eb9628cdef0216e9ac5ae6c118c671deb29ad705e0751b1', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.584962500721156, first_block=None, height=3, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=13, timestamp=1572653292.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', nonce=2900453906, timestamp=1572653292, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUA6/mkfdCoE0/VMGDn4pFDLOkJF6IrA==', token_data=0)], parents=['34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=14, timestamp=1572653292.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', nonce=2900453906, timestamp=1572653292, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUA6/mkfdCoE0/VMGDn4pFDLOkJF6IrA==', token_data=0)], parents=['34eb2302c10686be9755f4abc309ae6414dbd38a9a1b02c067f3b46f04def16c', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=4.807354922057604, first_block=None, height=4, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=15, timestamp=1572653293.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', nonce=71421764, timestamp=1572653293, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU+Rx7PbRe12ascscuo5C+ebnqXESIrA==', token_data=0)], parents=['4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=16, timestamp=1572653293.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', nonce=71421764, timestamp=1572653293, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU+Rx7PbRe12ascscuo5C+ebnqXESIrA==', token_data=0)], parents=['4f358aa26c3aec3ba29d67f7610d1efa01a71d82217c7f8cbfaf586ecaf46b4d', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.0, first_block=None, height=5, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=17, timestamp=1572653294.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', nonce=2877639466, timestamp=1572653294, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUR/OZE3YnG5JNA94GMjCapu+YyqiIrA==', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=18, timestamp=1572653294.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', nonce=2877639466, timestamp=1572653294, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUR/OZE3YnG5JNA94GMjCapu+YyqiIrA==', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=19, timestamp=1572653295.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', nonce=1254860223, timestamp=1572653295, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU2G9W3JjDgfDf92m10Y1SliEnJWSIrA==', token_data=0)], parents=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=20, timestamp=1572653295.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', nonce=1254860223, timestamp=1572653295, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU2G9W3JjDgfDf92m10Y1SliEnJWSIrA==', token_data=0)], parents=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=21, timestamp=1572653296.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', nonce=681687539, timestamp=1572653296, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzWAOeu+SS7iMOMU3PLGJWw0pzeCIrA==', token_data=0)], parents=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=22, timestamp=1572653296.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', nonce=681687539, timestamp=1572653296, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzWAOeu+SS7iMOMU3PLGJWw0pzeCIrA==', token_data=0)], parents=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=23, timestamp=1572653297.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', nonce=1629369717, timestamp=1572653297, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUSQT96vTRhrFDCpyd3UYpXzzizO2IrA==', token_data=0)], parents=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=24, timestamp=1572653297.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', nonce=1629369717, timestamp=1572653297, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUSQT96vTRhrFDCpyd3UYpXzzizO2IrA==', token_data=0)], parents=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=25, timestamp=1572653298.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', nonce=1825990282, timestamp=1572653298, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU3ME2MVjVXosrj6JwB1CUW5YpRpyIrA==', token_data=0)], parents=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=26, timestamp=1572653298.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', nonce=1825990282, timestamp=1572653298, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU3ME2MVjVXosrj6JwB1CUW5YpRpyIrA==', token_data=0)], parents=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=27, timestamp=1572653299.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', nonce=738245143, timestamp=1572653299, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUuSgyjGBpztv2JOEZEuBZ8hMWj0yIrA==', token_data=0)], parents=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=28, timestamp=1572653299.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', nonce=738245143, timestamp=1572653299, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUuSgyjGBpztv2JOEZEuBZ8hMWj0yIrA==', token_data=0)], parents=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=29, timestamp=1572653349.5, type='REORG_STARTED', data=ReorgData(reorg_size=6, previous_best_block='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', new_best_block='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', common_block='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850'), group_id=0), # noqa E501 - ], - UnorderedEventList([ - BaseEvent(peer_id=main_peer_id.id, id=30, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', nonce=1240, timestamp=1572653349, version=0, weight=10.0, inputs=[], outputs=[TxOutput(value=6400, script='', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=10.044394119358454, first_block=None, height=6, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=31, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', nonce=2877639466, timestamp=1572653294, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUR/OZE3YnG5JNA94GMjCapu+YyqiIrA==', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', spent_outputs=[], conflict_with=[], voided_by=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e'], received_by=[], children=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac'], twins=[], accumulated_weight=2.0, score=5.169925001442312, first_block=None, height=6, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=32, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', nonce=1825990282, timestamp=1572653298, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU3ME2MVjVXosrj6JwB1CUW5YpRpyIrA==', token_data=0)], parents=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', spent_outputs=[], conflict_with=[], voided_by=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e'], received_by=[], children=['ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6'], twins=[], accumulated_weight=2.0, score=5.700439718141092, first_block=None, height=10, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=33, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', nonce=681687539, timestamp=1572653296, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUzWAOeu+SS7iMOMU3PLGJWw0pzeCIrA==', token_data=0)], parents=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', spent_outputs=[], conflict_with=[], voided_by=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db'], received_by=[], children=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0'], twins=[], accumulated_weight=2.0, score=5.459431618637297, first_block=None, height=8, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=34, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', nonce=1629369717, timestamp=1572653297, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUSQT96vTRhrFDCpyd3UYpXzzizO2IrA==', token_data=0)], parents=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0', spent_outputs=[], conflict_with=[], voided_by=['6a04d02f03caecd8d9a5c5388fc15afd1022b2db13f68e79f7a4568ac30329d0'], received_by=[], children=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e'], twins=[], accumulated_weight=2.0, score=5.584962500721156, first_block=None, height=9, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=35, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', nonce=1254860223, timestamp=1572653295, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkU2G9W3JjDgfDf92m10Y1SliEnJWSIrA==', token_data=0)], parents=['c9066a952b25ff994461c39f16665602ee8b9d13da143307d264612d7e408d1e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac', spent_outputs=[], conflict_with=[], voided_by=['429543a84d186b6d3e6e20c41bfc6b26c812a18e04cc03deebf2d8ba05780aac'], received_by=[], children=['81e7e7d0b7fb462a2d56d3df26327d9668679b447db9bbc7dd76d2ec9e5970db'], twins=[], accumulated_weight=2.0, score=5.321928094887363, first_block=None, height=7, validation='full')), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=36, timestamp=1572653349.5, type='VERTEX_METADATA_CHANGED', data=TxData(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', nonce=738245143, timestamp=1572653299, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUuSgyjGBpztv2JOEZEuBZ8hMWj0yIrA==', token_data=0)], parents=['556f8669c2c5beb864e2f0b34090bd86dcd4922dc6ccef8108bc4ba69b785e9e', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', spent_outputs=[], conflict_with=[], voided_by=['ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6'], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=5.807354922057604, first_block=None, height=11, validation='full')), group_id=0), # noqa E501 - ]), - [ - BaseEvent(peer_id=main_peer_id.id, id=37, timestamp=1572653349.5, type='REORG_FINISHED', data=EmptyData(), group_id=0), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=38, timestamp=1572653349.5, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', nonce=1240, timestamp=1572653349, version=0, weight=10.0, inputs=[], outputs=[TxOutput(value=6400, script='', token_data=0)], parents=['b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=10.044394119358454, first_block=None, height=6, validation='full')), group_id=None), # noqa E501 - - BaseEvent(peer_id=main_peer_id.id, id=39, timestamp=1572653409.0, type='VERTEX_METADATA_CHANGED', data=TxData(hash='22b18e265b261368cd67387eb0a226dddb56341551c326f5dd9120d3b715b475', nonce=2183063884, timestamp=1572653409, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='22b18e265b261368cd67387eb0a226dddb56341551c326f5dd9120d3b715b475', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=10.049848549450562, first_block=None, height=7, validation='full')), group_id=None), # noqa E501 - BaseEvent(peer_id=main_peer_id.id, id=40, timestamp=1572653409.0, type='NEW_VERTEX_ACCEPTED', data=TxData(hash='22b18e265b261368cd67387eb0a226dddb56341551c326f5dd9120d3b715b475', nonce=2183063884, timestamp=1572653409, version=0, weight=2.0, inputs=[], outputs=[TxOutput(value=6400, script='dqkUm3CeNv0dX1HsZAvl2H0Cr6NZ40CIrA==', token_data=0)], parents=['0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', '16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952', '33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'], tokens=[], token_name=None, token_symbol=None, metadata=TxMetadata(hash='22b18e265b261368cd67387eb0a226dddb56341551c326f5dd9120d3b715b475', spent_outputs=[], conflict_with=[], voided_by=[], received_by=[], children=[], twins=[], accumulated_weight=2.0, score=10.049848549450562, first_block=None, height=7, validation='full')), group_id=None) # noqa E501 - ] - ] - - _assert_equal_events(actual_events, expected_events) - - -class UnorderedEventList(list): - def __eq__(self, other): - return _sorted_by_hash_without_id(self) == _sorted_by_hash_without_id(other) - - -def _assert_equal_events(actual_events, expected_events): - for actual_events_chunk, expected_events_chunk in zip_chunkify(actual_events, expected_events): - assert expected_events_chunk == actual_events_chunk, f'different chunks:\n' \ - f'expected: {expected_events_chunk}\n' \ - f'actual: {actual_events_chunk}' - - -def _sorted_by_hash_without_id(events: list[BaseEvent]) -> list[BaseEvent]: - events_without_id = [event.copy(exclude={'id'}) for event in events] - - def key(event: BaseEvent) -> str: - assert isinstance(event.data, TxData), f'only tx events can be sorted. event.data type: {type(event.data)}' - return event.data.hash - - return sorted(events_without_id, key=key)