diff --git a/hathor/builder/builder.py b/hathor/builder/builder.py index 816486916..59065e330 100644 --- a/hathor/builder/builder.py +++ b/hathor/builder/builder.py @@ -83,6 +83,7 @@ def __init__(self) -> None: self._event_manager: Optional[EventManager] = None self._event_ws_factory: Optional[EventWebsocketFactory] = None + self._enable_event_queue: Optional[bool] = None self._rocksdb_path: Optional[str] = None self._rocksdb_storage: Optional[RocksDBStorage] = None @@ -126,7 +127,6 @@ def build(self) -> BuildArtifacts: consensus_algorithm = ConsensusAlgorithm(soft_voided_tx_ids, pubsub) wallet = self._get_or_create_wallet() - event_storage = self._get_or_create_event_storage() event_manager = self._get_or_create_event_manager() tx_storage = self._get_or_create_tx_storage() indexes = tx_storage.indexes @@ -158,20 +158,22 @@ def build(self) -> BuildArtifacts: if self._full_verification is not None: kwargs['full_verification'] = self._full_verification + if self._enable_event_queue is not None: + kwargs['enable_event_queue'] = self._enable_event_queue + manager = HathorManager( reactor, pubsub=pubsub, consensus_algorithm=consensus_algorithm, peer_id=peer_id, tx_storage=tx_storage, - event_storage=event_storage, + event_manager=event_manager, network=self._network, wallet=wallet, rng=self._rng, checkpoints=self._checkpoints, capabilities=self._capabilities, environment_info=get_environment_info(self._cmdline, peer_id.id), - event_manager=event_manager, **kwargs ) @@ -299,8 +301,8 @@ def _get_or_create_event_storage(self) -> EventStorage: return self._event_storage - def _get_or_create_event_manager(self) -> Optional[EventManager]: - if self._event_manager is None and self._event_ws_factory is not None: + def _get_or_create_event_manager(self) -> EventManager: + if self._event_manager is None: self._event_manager = EventManager( reactor=self._get_reactor(), pubsub=self._get_or_create_pubsub(), @@ -385,6 +387,7 @@ def enable_wallet_index(self) -> 'Builder': def enable_event_manager(self, *, event_ws_factory: EventWebsocketFactory) -> 'Builder': self.check_if_can_modify() + self._enable_event_queue = True self._event_ws_factory = event_ws_factory return self diff --git a/hathor/builder/cli_builder.py b/hathor/builder/cli_builder.py index f0485a853..064f19e2a 100644 --- a/hathor/builder/cli_builder.py +++ b/hathor/builder/cli_builder.py @@ -143,19 +143,15 @@ def create_manager(self, reactor: PosixReactorBase, args: Namespace) -> HathorMa pubsub = PubSubManager(reactor) - event_manager: Optional[EventManager] = None if args.x_enable_event_queue: self.event_ws_factory = EventWebsocketFactory(reactor, event_storage) - event_manager = EventManager( - event_storage=event_storage, - event_ws_factory=self.event_ws_factory, - pubsub=pubsub, - reactor=reactor, - emit_load_events=args.x_emit_load_events - ) - else: - self.check_or_raise(not args.x_emit_load_events, '--x-emit-load-events cannot be used without ' - '--x-enable-event-queue') + + event_manager = EventManager( + event_storage=event_storage, + event_ws_factory=self.event_ws_factory, + pubsub=pubsub, + reactor=reactor + ) if args.wallet_index and tx_storage.indexes is not None: self.log.debug('enable wallet indexes') @@ -181,7 +177,6 @@ def create_manager(self, reactor: PosixReactorBase, args: Namespace) -> HathorMa network=network, hostname=hostname, tx_storage=tx_storage, - event_storage=event_storage, event_manager=event_manager, wallet=self.wallet, stratum_port=args.stratum, @@ -191,7 +186,8 @@ def create_manager(self, reactor: PosixReactorBase, args: Namespace) -> HathorMa enable_sync_v2=enable_sync_v2, consensus_algorithm=consensus_algorithm, environment_info=get_environment_info(args=str(args), peer_id=peer_id.id), - full_verification=full_verification + full_verification=full_verification, + enable_event_queue=bool(args.x_enable_event_queue) ) if args.allow_mining_without_peers: @@ -235,7 +231,7 @@ def create_manager(self, reactor: PosixReactorBase, args: Namespace) -> HathorMa self.manager.enable_event_queue = True self.log.info('--x-enable-event-queue flag provided. ' - 'The events detected by the full node will be stored and retrieved to clients') + 'The events detected by the full node will be stored and can be retrieved by clients') for description in args.listen: self.manager.add_listen_address(description) @@ -508,7 +504,7 @@ def create_resources(self, args: Namespace) -> server.Site: ws_factory.subscribe(self.manager.pubsub) # Event websocket resource - if args.x_enable_event_queue and self.event_ws_factory is not None: + if args.x_enable_event_queue: root.putChild(b'event_ws', WebSocketResource(self.event_ws_factory)) root.putChild(b'event', EventResource(self.manager._event_manager)) diff --git a/hathor/cli/events_simulator/events_simulator.py b/hathor/cli/events_simulator/events_simulator.py index a265449a8..7d09f1cfa 100644 --- a/hathor/cli/events_simulator/events_simulator.py +++ b/hathor/cli/events_simulator/events_simulator.py @@ -37,7 +37,7 @@ def execute(args: Namespace) -> None: storage = EventMemoryStorage() - for event in args.scenario.get_events(): + for event in args.scenario.value: storage.save_event(event) factory = EventWebsocketFactory(reactor, storage) diff --git a/hathor/cli/events_simulator/scenario.py b/hathor/cli/events_simulator/scenario.py index 718b11b99..218ed3eaf 100644 --- a/hathor/cli/events_simulator/scenario.py +++ b/hathor/cli/events_simulator/scenario.py @@ -14,63 +14,119 @@ from enum import Enum -from hathor.event.model.base_event import BaseEvent -from hathor.event.model.event_data import TxData, TxMetadata -from hathor.event.model.event_type import EventType +from hathor.event.model.base_event import BaseEvent, EventType +from hathor.event.model.event_data import EmptyData, ReorgData, SpentOutput, TxData, TxInput, TxMetadata, TxOutput +_ONLY_LOAD_EVENTS = [ + BaseEvent(peer_id='97c14daade28cfe68d5854361bf6d5754b2a1f81e38fb44fe51367f1eb254d11', id=0, timestamp=1572653259.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='97c14daade28cfe68d5854361bf6d5754b2a1f81e38fb44fe51367f1eb254d11', id=1, timestamp=1572653259.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')), group_id=None), # noqa E501 + BaseEvent(peer_id='97c14daade28cfe68d5854361bf6d5754b2a1f81e38fb44fe51367f1eb254d11', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='97c14daade28cfe68d5854361bf6d5754b2a1f81e38fb44fe51367f1eb254d11', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='97c14daade28cfe68d5854361bf6d5754b2a1f81e38fb44fe51367f1eb254d11', id=4, timestamp=1572653259.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None) # noqa E501 +] -class Scenario(Enum): - SINGLE_CHAIN = 'SINGLE_CHAIN' - BEST_CHAIN_WITH_SIDE_CHAINS = 'BEST_CHAIN_WITH_SIDE_CHAINS' - MULTIPLE_FORKS = 'MULTIPLE_FORKS' - - def get_events(self): - return _SCENARIO_EVENTS[self] +_SINGLE_CHAIN_ONE_BLOCK_EVENTS = [ + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', id=0, timestamp=1572653259.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', id=1, timestamp=1572653259.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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', id=4, timestamp=1572653259.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', id=5, 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', id=6, 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='30035f10e02f83ec585bf3ab9e8f41ec905d11a06fdca737be28dfa919e14d26', 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')), group_id=None) # noqa E501 +] -_TRANSACTION_DATA_1 = TxData( - hash='123', - nonce=456, - timestamp=0, - version=1, - weight=2, - inputs=[], - outputs=[], - parents=[], - tokens=[], - metadata=TxMetadata( - hash='123', - spent_outputs=[], - conflict_with=[], - voided_by=[], - received_by=[], - children=[], - twins=[], - accumulated_weight=2, - score=2, - height=0, - validation='' - ) -) +_SINGLE_CHAIN_BLOCKS_AND_TRANSACTIONS_EVENTS = [ + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=0, timestamp=1572653259.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=1, timestamp=1572653259.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')), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=4, timestamp=1572653259.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=5, timestamp=1572653289.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=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=6, timestamp=1572653289.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=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=7, timestamp=1572653289.25, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=8, timestamp=1572653289.25, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=9, timestamp=1572653290.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=10, timestamp=1572653290.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=11, timestamp=1572653291.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=12, timestamp=1572653291.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=13, timestamp=1572653292.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=14, timestamp=1572653292.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=15, timestamp=1572653293.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=16, timestamp=1572653293.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=17, timestamp=1572653294.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=18, timestamp=1572653294.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=19, timestamp=1572653295.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=20, timestamp=1572653295.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=21, timestamp=1572653296.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=22, timestamp=1572653296.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=23, timestamp=1572653297.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=24, timestamp=1572653297.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=25, timestamp=1572653298.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=26, timestamp=1572653298.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=27, timestamp=1572653299.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=28, timestamp=1572653299.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=29, timestamp=1572653370.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=30, timestamp=1572653370.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=31, timestamp=1572653370.0, type=EventType.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 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=32, timestamp=1572653384.75, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=33, timestamp=1572653384.75, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=34, timestamp=1572653384.75, type=EventType.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 + BaseEvent(peer_id='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=35, timestamp=1572653409.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=36, timestamp=1572653409.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=37, timestamp=1572653409.0, type=EventType.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='bdf4fa876f5cdba84be0cab53b21fc9eb45fe4b3d6ede99f493119d37df4e560', id=38, timestamp=1572653409.0, type=EventType.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 +] -_TRANSACTION_1 = BaseEvent( - peer_id='123', - id=0, - timestamp=0, - type=EventType.NEW_VERTEX_ACCEPTED, - data=_TRANSACTION_DATA_1 -) +_REORG_EVENTS = [ + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=0, timestamp=1572653259.0, type=EventType.LOAD_STARTED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=1, timestamp=1572653259.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')), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', 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')), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=4, timestamp=1572653259.0, type=EventType.LOAD_FINISHED, data=EmptyData(), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=5, timestamp=1572653289.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=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=6, timestamp=1572653289.25, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=7, timestamp=1572653289.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=['d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2'], twins=[], accumulated_weight=2.0, score=2.0, first_block='d8d221392cda50bdb2c4bef1f11f826ddcad85ddab395d062d05fc4a592195c2', height=0, validation='full')), group_id=None), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=8, timestamp=1572653289.25, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=9, timestamp=1572653290.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=10, timestamp=1572653290.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=11, timestamp=1572653291.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=12, timestamp=1572653291.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=13, timestamp=1572653292.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=14, timestamp=1572653292.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=15, timestamp=1572653293.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=16, timestamp=1572653293.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=17, timestamp=1572653294.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=18, timestamp=1572653294.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=19, timestamp=1572653295.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=20, timestamp=1572653295.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=21, timestamp=1572653296.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=22, timestamp=1572653296.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=23, timestamp=1572653297.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=24, timestamp=1572653297.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=25, timestamp=1572653298.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=26, timestamp=1572653298.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=27, timestamp=1572653299.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=28, timestamp=1572653299.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=29, timestamp=1572653349.5, type=EventType.REORG_STARTED, data=ReorgData(reorg_size=6, previous_best_block='ddf62cc80ce6aa1a64fe89b5d15af59555e94126f88618eb28fae6a5b51fcae6', new_best_block='0016af90a6db3534d4c958ccb229e5abba279e79adc6199b08c2b7db96fa73da', common_block='b9d8a77417f01e03ac13805c7d23f84367c72efb087aabaa8a6ce9669f407850'), group_id=0), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=30, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=31, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=32, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=33, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=34, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=35, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=36, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=37, timestamp=1572653349.5, type=EventType.REORG_FINISHED, data=EmptyData(), group_id=0), # noqa E501 + BaseEvent(peer_id='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=38, timestamp=1572653349.5, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=39, timestamp=1572653409.0, type=EventType.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='fbcaa3d97704e1055be6eeb812befa1abcbe9074d778e5e071d5e18b4c4cec4d', id=40, timestamp=1572653409.0, type=EventType.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 +] -# TODO: We still have to actually populate the list of events for each scenario. Pending on design discussions. -_SCENARIO_EVENTS = { - Scenario.SINGLE_CHAIN: [ - _TRANSACTION_1 - ], - Scenario.BEST_CHAIN_WITH_SIDE_CHAINS: [ - _TRANSACTION_1 - ], - Scenario.MULTIPLE_FORKS: [ - _TRANSACTION_1 - ], -} +class Scenario(Enum): + ONLY_LOAD = _ONLY_LOAD_EVENTS + SINGLE_CHAIN_ONE_BLOCK = _SINGLE_CHAIN_ONE_BLOCK_EVENTS + SINGLE_CHAIN_BLOCKS_AND_TRANSACTIONS = _SINGLE_CHAIN_BLOCKS_AND_TRANSACTIONS_EVENTS + REORG = _REORG_EVENTS diff --git a/hathor/cli/run_node.py b/hathor/cli/run_node.py index d708c86bd..2ccf3f8cc 100644 --- a/hathor/cli/run_node.py +++ b/hathor/cli/run_node.py @@ -96,8 +96,6 @@ def create_parser(cls) -> ArgumentParser: parser.add_argument('--x-localhost-only', action='store_true', help='Only connect to peers on localhost') parser.add_argument('--x-rocksdb-indexes', action='store_true', help=SUPPRESS) parser.add_argument('--x-enable-event-queue', action='store_true', help='Enable event queue mechanism') - parser.add_argument('--x-emit-load-events', action='store_true', help='Enable emission of events during the ' - 'LOAD phase') parser.add_argument('--peer-id-blacklist', action='extend', default=[], nargs='+', type=str, help='Peer IDs to forbid connection') return parser diff --git a/hathor/event/event_manager.py b/hathor/event/event_manager.py index 4ab06cbe4..ff3197b29 100644 --- a/hathor/event/event_manager.py +++ b/hathor/event/event_manager.py @@ -12,15 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Callable, Optional +from typing import Callable, Iterator, Optional from structlog import get_logger from hathor.event.model.base_event import BaseEvent from hathor.event.model.event_type import EventType +from hathor.event.model.node_state import NodeState from hathor.event.storage import EventStorage from hathor.event.websocket import EventWebsocketFactory from hathor.pubsub import EventArguments, HathorEvents, PubSubManager +from hathor.transaction import BaseTransaction from hathor.util import Reactor logger = get_logger() @@ -51,7 +53,9 @@ class EventManager: _peer_id: str _is_running: bool = False - _load_finished: bool = False + _previous_node_state: Optional[NodeState] = None + _last_event: Optional[BaseEvent] = None + _last_existing_group_id: Optional[int] = None @property def event_storage(self) -> EventStorage: @@ -60,34 +64,40 @@ def event_storage(self) -> EventStorage: def __init__( self, event_storage: EventStorage, - event_ws_factory: EventWebsocketFactory, pubsub: PubSubManager, reactor: Reactor, - emit_load_events: bool = False + event_ws_factory: Optional[EventWebsocketFactory] = None, ): self.log = logger.new() - self._clock = reactor + self._reactor = reactor self._event_storage = event_storage self._event_ws_factory = event_ws_factory self._pubsub = pubsub - self.emit_load_events = emit_load_events - self._last_event = self._event_storage.get_last_event() - self._last_existing_group_id = self._event_storage.get_last_group_id() + def start(self, peer_id: str) -> None: + assert self._is_running is False, 'Cannot start, EventManager is already running' + assert self._event_ws_factory is not None, 'Cannot start, EventWebsocketFactory is not set' + assert self.get_event_queue_state() is True, 'Cannot start, event queue feature is disabled' + + self._previous_node_state = self._event_storage.get_node_state() + + if self._should_reload_events(): + self._event_storage.clear_events() + else: + self._last_event = self._event_storage.get_last_event() + self._last_existing_group_id = self._event_storage.get_last_group_id() self._assert_closed_event_group() self._subscribe_events() - def start(self, peer_id: str) -> None: - assert self._is_running is False, 'Cannot start, EventManager is already running' - self._peer_id = peer_id self._event_ws_factory.start() self._is_running = True def stop(self): assert self._is_running is True, 'Cannot stop, EventManager is not running' + assert self._event_ws_factory is not None self._event_ws_factory.stop() self._is_running = False @@ -110,25 +120,28 @@ def _subscribe_events(self): """ Subscribe to defined events for the pubsub received """ for event in _SUBSCRIBE_EVENTS: - self._pubsub.subscribe(event, self._handle_event) + self._pubsub.subscribe(event, self._handle_hathor_event) + + def _handle_hathor_event(self, hathor_event: HathorEvents, event_args: EventArguments) -> None: + event_type = EventType.from_hathor_event(hathor_event) + + self._handle_event(event_type, event_args) - def _handle_event(self, hathor_event: HathorEvents, event_args: EventArguments) -> None: + def _handle_event(self, event_type: EventType, event_args: EventArguments) -> None: assert self._is_running, 'Cannot handle event, EventManager is not started.' - event_type = EventType.from_hathor_event(hathor_event) event_specific_handlers = { + EventType.LOAD_STARTED: self._handle_load_started, EventType.LOAD_FINISHED: self._handle_load_finished } if event_specific_handler := event_specific_handlers.get(event_type): event_specific_handler() - if not self._load_finished and not self.emit_load_events: - return - self._handle_event_creation(event_type, event_args) def _handle_event_creation(self, event_type: EventType, event_args: EventArguments) -> None: + assert self._event_ws_factory is not None create_event_fn: Callable[[EventType, EventArguments], BaseEvent] if event_type in _GROUP_START_EVENTS: @@ -181,9 +194,6 @@ def _create_non_group_edge_event(self, event_type: EventType, event_args: EventA group_id=group_id, ) - def _handle_load_finished(self): - self._load_finished = True - def _create_event( self, event_type: EventType, @@ -193,8 +203,42 @@ def _create_event( return BaseEvent.from_event_arguments( event_id=0 if self._last_event is None else self._last_event.id + 1, peer_id=self._peer_id, - timestamp=self._clock.seconds(), + timestamp=self._reactor.seconds(), event_type=event_type, event_args=event_args, group_id=group_id, ) + + def _handle_load_started(self): + self._event_storage.save_node_state(NodeState.LOAD) + + def _handle_load_finished(self): + self._event_storage.save_node_state(NodeState.SYNC) + + def _should_reload_events(self) -> bool: + return self._previous_node_state in [None, NodeState.LOAD] + + def get_event_queue_state(self) -> bool: + """Get whether the event queue feature is enabled from the storage""" + return self._event_storage.get_event_queue_state() + + def save_event_queue_state(self, state: bool) -> None: + self._event_storage.save_event_queue_state(state) + + def handle_load_phase_vertices(self, topological_iterator: Iterator[BaseTransaction]) -> None: + """ + Either generates load phase events or not, depending on previous node state. + Does so asynchronously so events generated here are not processed before normal event handling. + """ + assert self._is_running, 'Cannot handle load phase events, EventManager is not started.' + + if not self._should_reload_events(): + return + + for vertex in topological_iterator: + self._reactor.callLater( + delay=0, + callable=self._handle_event, + event_type=EventType.NEW_VERTEX_ACCEPTED, + event_args=EventArguments(tx=vertex) + ) diff --git a/hathor/event/model/node_state.py b/hathor/event/model/node_state.py new file mode 100644 index 000000000..161e0061d --- /dev/null +++ b/hathor/event/model/node_state.py @@ -0,0 +1,20 @@ +# 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 enum import Enum + + +class NodeState(Enum): + LOAD = 0 + SYNC = 1 diff --git a/hathor/event/storage/event_storage.py b/hathor/event/storage/event_storage.py index c91b14d79..90a68d761 100644 --- a/hathor/event/storage/event_storage.py +++ b/hathor/event/storage/event_storage.py @@ -16,6 +16,7 @@ from typing import Iterator, Optional from hathor.event.model.base_event import BaseEvent +from hathor.event.model.node_state import NodeState class EventStorage(ABC): @@ -43,3 +44,28 @@ def get_last_group_id(self) -> Optional[int]: def iter_from_event(self, key: int) -> Iterator[BaseEvent]: """ Iterate through events starting from the event with the given key""" raise NotImplementedError + + @abstractmethod + def clear_events(self) -> None: + """Clear all stored events and related metadata.""" + raise NotImplementedError + + @abstractmethod + def save_node_state(self, state: NodeState) -> None: + """Save a node state in the storage""" + raise NotImplementedError + + @abstractmethod + def get_node_state(self) -> Optional[NodeState]: + """Get the node state from the storage""" + raise NotImplementedError + + @abstractmethod + def save_event_queue_state(self, enabled: bool) -> None: + """Save whether the event queue feature is enabled in the storage""" + raise NotImplementedError + + @abstractmethod + def get_event_queue_state(self) -> bool: + """Get whether the event queue feature is enabled from the storage""" + raise NotImplementedError diff --git a/hathor/event/storage/memory_storage.py b/hathor/event/storage/memory_storage.py index da458276b..e3473eec3 100644 --- a/hathor/event/storage/memory_storage.py +++ b/hathor/event/storage/memory_storage.py @@ -15,6 +15,7 @@ from typing import Iterator, List, Optional from hathor.event.model.base_event import BaseEvent +from hathor.event.model.node_state import NodeState from hathor.event.storage.event_storage import EventStorage @@ -23,6 +24,8 @@ def __init__(self): self._events: List[BaseEvent] = [] self._last_event: Optional[BaseEvent] = None self._last_group_id: Optional[int] = None + self._node_state: Optional[NodeState] = None + self._event_queue_enabled: bool = False def save_event(self, event: BaseEvent) -> None: if event.id != len(self._events): @@ -54,3 +57,20 @@ def iter_from_event(self, key: int) -> Iterator[BaseEvent]: while key < len(self._events): yield self._events[key] key += 1 + + def clear_events(self) -> None: + self._events = [] + self._last_event = None + self._last_group_id = None + + def save_node_state(self, state: NodeState) -> None: + self._node_state = state + + def get_node_state(self) -> Optional[NodeState]: + return self._node_state + + def save_event_queue_state(self, enabled: bool) -> None: + self._event_queue_enabled = enabled + + def get_event_queue_state(self) -> bool: + return self._event_queue_enabled diff --git a/hathor/event/storage/rocksdb_storage.py b/hathor/event/storage/rocksdb_storage.py index 5f5f02424..eae5f5305 100644 --- a/hathor/event/storage/rocksdb_storage.py +++ b/hathor/event/storage/rocksdb_storage.py @@ -15,21 +15,27 @@ from typing import Iterator, Optional from hathor.event.model.base_event import BaseEvent +from hathor.event.model.node_state import NodeState from hathor.event.storage.event_storage import EventStorage from hathor.storage.rocksdb_storage import RocksDBStorage -from hathor.transaction.util import int_to_bytes +from hathor.transaction.util import bytes_to_int, int_to_bytes from hathor.util import json_dumpb _CF_NAME_EVENT = b'event' _CF_NAME_META = b'event-metadata' _KEY_LAST_GROUP_ID = b'last-group-id' +_KEY_NODE_STATE = b'node-state' +_KEY_EVENT_QUEUE_ENABLED = b'event-queue-enabled' class EventRocksDBStorage(EventStorage): def __init__(self, rocksdb_storage: RocksDBStorage): - self._db = rocksdb_storage.get_db() - self._cf_event = rocksdb_storage.get_or_create_column_family(_CF_NAME_EVENT) - self._cf_meta = rocksdb_storage.get_or_create_column_family(_CF_NAME_META) + self._rocksdb_storage = rocksdb_storage + + self._db = self._rocksdb_storage.get_db() + self._cf_event = self._rocksdb_storage.get_or_create_column_family(_CF_NAME_EVENT) + self._cf_meta = self._rocksdb_storage.get_or_create_column_family(_CF_NAME_META) + self._last_event: Optional[BaseEvent] = self._db_get_last_event() self._last_group_id: Optional[int] = self._db_get_last_group_id() @@ -57,11 +63,11 @@ def _db_get_last_group_id(self) -> Optional[int]: last_group_id = self._db.get((self._cf_meta, _KEY_LAST_GROUP_ID)) if last_group_id is None: return None - return int.from_bytes(last_group_id, byteorder='big', signed=False) + return bytes_to_int(last_group_id) def save_event(self, event: BaseEvent) -> None: if (self._last_event is None and event.id != 0) or \ - (self._last_event is not None and event.id > self._last_event.id + 1): + (self._last_event is not None and event.id != self._last_event.id + 1): raise ValueError('invalid event.id, ids must be sequential and leave no gaps') event_data = json_dumpb(event.dict()) key = int_to_bytes(event.id, 8) @@ -84,3 +90,39 @@ def get_last_event(self) -> Optional[BaseEvent]: def get_last_group_id(self) -> Optional[int]: return self._last_group_id + + def clear_events(self) -> None: + self._last_event = None + self._last_group_id = None + + self._db.delete((self._cf_meta, _KEY_LAST_GROUP_ID)) + self._db.drop_column_family(self._cf_event) + + self._cf_event = self._rocksdb_storage.get_or_create_column_family(_CF_NAME_EVENT) + + def save_node_state(self, state: NodeState) -> None: + self._db.put((self._cf_meta, _KEY_NODE_STATE), int_to_bytes(state.value, 8)) + + def get_node_state(self) -> Optional[NodeState]: + node_state_bytes = self._db.get((self._cf_meta, _KEY_NODE_STATE)) + + if node_state_bytes is None: + return None + + node_state_int = bytes_to_int(node_state_bytes) + + return NodeState(node_state_int) + + def save_event_queue_state(self, enabled: bool) -> None: + self._db.put( + (self._cf_meta, _KEY_EVENT_QUEUE_ENABLED), + enabled.to_bytes(length=1, byteorder='big') + ) + + def get_event_queue_state(self) -> bool: + enabled_bytes = self._db.get((self._cf_meta, _KEY_EVENT_QUEUE_ENABLED)) + + if enabled_bytes is None: + return False + + return bool.from_bytes(enabled_bytes, byteorder='big') diff --git a/hathor/manager.py b/hathor/manager.py index 32019cb90..916a92bc6 100644 --- a/hathor/manager.py +++ b/hathor/manager.py @@ -30,7 +30,6 @@ from hathor.conf import HathorSettings from hathor.consensus import ConsensusAlgorithm from hathor.event.event_manager import EventManager -from hathor.event.storage import EventStorage from hathor.exception import ( DoubleSpendingError, HathorError, @@ -88,11 +87,10 @@ def __init__(self, consensus_algorithm: ConsensusAlgorithm, peer_id: PeerId, tx_storage: TransactionStorage, - event_storage: EventStorage, + event_manager: EventManager, network: str, hostname: Optional[str] = None, wallet: Optional[BaseWallet] = None, - event_manager: Optional[EventManager] = None, stratum_port: Optional[int] = None, ssl: bool = True, enable_sync_v1: bool = True, @@ -101,7 +99,8 @@ def __init__(self, checkpoints: Optional[List[Checkpoint]] = None, rng: Optional[Random] = None, environment_info: Optional[EnvironmentInfo] = None, - full_verification: bool = False): + full_verification: bool = False, + enable_event_queue: bool = False): """ :param reactor: Twisted reactor which handles the mainloop and the events. :param peer_id: Id of this node. @@ -124,6 +123,11 @@ def __init__(self, if not (enable_sync_v1 or enable_sync_v2): raise TypeError(f'{type(self).__name__}() at least one sync version is required') + if event_manager.get_event_queue_state() is True and not enable_event_queue: + raise ValueError( + 'cannot start manager without event queue feature, as it was enabled in the previous startup' + ) + self._enable_sync_v1 = enable_sync_v1 self._enable_sync_v2 = enable_sync_v2 @@ -169,9 +173,8 @@ def __init__(self, self.tx_storage.pubsub = self.pubsub self._event_manager = event_manager - - if self._event_manager: - assert self._event_manager.event_storage == event_storage + self._event_manager.save_event_queue_state(enable_event_queue) + self._enable_event_queue = enable_event_queue if enable_sync_v2: assert self.tx_storage.indexes is not None @@ -281,7 +284,7 @@ def start(self) -> None: ) sys.exit(-1) - if self._event_manager: + if self._enable_event_queue: self._event_manager.start(not_none(self.my_peer.id)) self.state = self.NodeState.INITIALIZING @@ -351,7 +354,7 @@ def stop(self) -> Deferred: if wait_stratum: waits.append(wait_stratum) - if self._event_manager: + if self._enable_event_queue: self._event_manager.stop() self.tx_storage.flush() @@ -392,7 +395,7 @@ def _initialize_components(self) -> None: This method runs through all transactions, verifying them and updating our wallet. """ - assert not self._event_manager, 'this method cannot be used if the events feature is enabled.' + assert not self._enable_event_queue, 'this method cannot be used if the events feature is enabled.' self.log.info('initialize') if self.wallet: @@ -645,6 +648,11 @@ def _initialize_components_new(self) -> None: # XXX: last step before actually starting is updating the last started at timestamps self.tx_storage.update_last_started_at(started_at) + + if self._enable_event_queue: + topological_iterator = self.tx_storage.topological_iterator() + self._event_manager.handle_load_phase_vertices(topological_iterator) + self.state = self.NodeState.READY self.pubsub.publish(HathorEvents.LOAD_FINISHED) diff --git a/hathor/pubsub.py b/hathor/pubsub.py index 255088f80..0a0e0153e 100644 --- a/hathor/pubsub.py +++ b/hathor/pubsub.py @@ -90,9 +90,6 @@ class HathorEvents(Enum): REORG_FINISHED Triggered when consensus algorithm ends all changes involved in a reorg - - VERTEX_METADATA_CHANGED - Triggered when consensus algorithm changes a metadata of an existing vertex (transaction or block) """ MANAGER_ON_START = 'manager:on_start' MANAGER_ON_STOP = 'manager:on_stop' diff --git a/hathor/simulator/miner/dummy_miner.py b/hathor/simulator/miner/dummy_miner.py new file mode 100644 index 000000000..0c335e0ca --- /dev/null +++ b/hathor/simulator/miner/dummy_miner.py @@ -0,0 +1,68 @@ +# 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 typing import List + +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]): + 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 6831c3bcf..fcde6c626 100644 --- a/hathor/simulator/simulator.py +++ b/hathor/simulator/simulator.py @@ -27,6 +27,7 @@ from hathor.manager import HathorManager from hathor.p2p.peer_id import PeerId 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 @@ -181,6 +182,9 @@ 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/hathor/transaction/util.py b/hathor/transaction/util.py index 0f88ed86c..fb9b1b9c7 100644 --- a/hathor/transaction/util.py +++ b/hathor/transaction/util.py @@ -28,6 +28,19 @@ def int_to_bytes(number: int, size: int, signed: bool = False) -> bytes: return number.to_bytes(size, byteorder='big', signed=signed) +def bytes_to_int(data: bytes, *, signed: bool = False) -> int: + """ + Converts data in bytes to an int. Assumes big-endian format. + + Args: + data: bytes to be converted + signed: whether two's complement is used to represent the integer. + + Returns: the converted data as int + """ + return int.from_bytes(data, byteorder='big', signed=signed) + + def unpack(fmt: str, buf: bytes) -> Any: size = struct.calcsize(fmt) return struct.unpack(fmt, buf[:size]), buf[size:] diff --git a/tests/event/test_event_manager.py b/tests/event/test_event_manager.py index 1b4f7250f..0f602a9fe 100644 --- a/tests/event/test_event_manager.py +++ b/tests/event/test_event_manager.py @@ -42,19 +42,32 @@ def test_event_group(self): self._fake_reorg_started() self._fake_reorg_finished() self.run_to_completion() + event0 = self.event_storage.get_event(0) event1 = self.event_storage.get_event(1) event2 = self.event_storage.get_event(2) event3 = self.event_storage.get_event(3) event4 = self.event_storage.get_event(4) - self.assertEqual(EventType(event0.type), EventType.LOAD_FINISHED) - self.assertEqual(EventType(event1.type), EventType.REORG_STARTED) - self.assertIsNotNone(event1.group_id) - self.assertEqual(EventType(event2.type), EventType.REORG_FINISHED) - self.assertIsNotNone(event2.group_id) - self.assertEqual(event1.group_id, event2.group_id) - self.assertNotEqual(event2.group_id, event3.group_id) - self.assertEqual(event3.group_id, event4.group_id) + event5 = self.event_storage.get_event(5) + event6 = self.event_storage.get_event(6) + event7 = self.event_storage.get_event(7) + event8 = self.event_storage.get_event(8) + + self.assertEqual(EventType(event0.type), EventType.LOAD_STARTED) + self.assertEqual(EventType(event1.type), EventType.NEW_VERTEX_ACCEPTED) + self.assertEqual(EventType(event2.type), EventType.NEW_VERTEX_ACCEPTED) + self.assertEqual(EventType(event3.type), EventType.NEW_VERTEX_ACCEPTED) + self.assertEqual(EventType(event4.type), EventType.LOAD_FINISHED) + self.assertEqual(EventType(event5.type), EventType.REORG_STARTED) + + self.assertIsNotNone(event5.group_id) + self.assertEqual(EventType(event6.type), EventType.REORG_FINISHED) + self.assertIsNotNone(event6.group_id) + self.assertEqual(event5.group_id, event6.group_id) + + self.assertNotEqual(event6.group_id, event7.group_id) + self.assertIsNotNone(event7.group_id) + self.assertEqual(event7.group_id, event8.group_id) def test_cannot_start_group_twice(self): self._fake_reorg_started() diff --git a/tests/event/test_event_reorg.py b/tests/event/test_event_reorg.py index fa69a4fac..878e21b39 100644 --- a/tests/event/test_event_reorg.py +++ b/tests/event/test_event_reorg.py @@ -58,6 +58,10 @@ class unsorted(list): pass expected_events_grouped = [ [ + (EventType.LOAD_STARTED, {}), + (EventType.NEW_VERTEX_ACCEPTED, {'hash': settings.GENESIS_BLOCK_HASH.hex()}), + (EventType.NEW_VERTEX_ACCEPTED, {'hash': settings.GENESIS_TX1_HASH.hex()}), + (EventType.NEW_VERTEX_ACCEPTED, {'hash': settings.GENESIS_TX2_HASH.hex()}), (EventType.LOAD_FINISHED, {}) ], # XXX: the order of the following events can vary depending on which genesis is spent/confirmed first diff --git a/tests/event/test_event_storage.py b/tests/event/test_event_storage.py index f2441f3a5..4889bcb15 100644 --- a/tests/event/test_event_storage.py +++ b/tests/event/test_event_storage.py @@ -2,6 +2,8 @@ import pytest +from hathor.event.model.node_state import NodeState +from hathor.event.storage import EventStorage from hathor.event.storage.memory_storage import EventMemoryStorage from hathor.event.storage.rocksdb_storage import EventRocksDBStorage from hathor.storage.rocksdb_storage import RocksDBStorage @@ -12,6 +14,8 @@ class EventStorageBaseTest(unittest.TestCase): __test__ = False + event_storage: EventStorage + def setUp(self): super().setUp() self.event_mocker = EventMocker(self.rng) @@ -92,15 +96,88 @@ def test_iter_from_event_negative_key(self): def test_save_events_and_retrieve_last_group_id(self): expected_group_id = 4 - for i in range(10): - group_id = i if i <= expected_group_id else None - event = self.event_mocker.generate_mocked_event(i, group_id) - self.event_storage.save_event(event) + + self._populate_events_and_last_group_id(n_events=10, last_group_id=expected_group_id) actual_group_id = self.event_storage.get_last_group_id() assert expected_group_id == actual_group_id + def _populate_events_and_last_group_id(self, n_events: int, last_group_id: int) -> None: + for i in range(n_events): + group_id = i if i <= last_group_id else None + event = self.event_mocker.generate_mocked_event(i, group_id) + self.event_storage.save_event(event) + + def test_get_empty_node_state(self): + node_state = self.event_storage.get_node_state() + + assert node_state is None + + def test_save_node_state_and_retrieve(self): + self.event_storage.save_node_state(NodeState.SYNC) + node_state = self.event_storage.get_node_state() + + assert node_state == NodeState.SYNC + + def test_get_empty_event_queue_state(self): + enabled = self.event_storage.get_event_queue_state() + + assert enabled is False + + def test_save_event_queue_enabled_and_retrieve(self): + self.event_storage.save_event_queue_state(True) + enabled = self.event_storage.get_event_queue_state() + + assert enabled is True + + def test_save_event_queue_disabled_and_retrieve(self): + self.event_storage.save_event_queue_state(False) + enabled = self.event_storage.get_event_queue_state() + + assert enabled is False + + def test_clear_events_empty_database(self): + self._test_clear_events() + + def _test_clear_events(self) -> None: + self.event_storage.clear_events() + + events = list(self.event_storage.iter_from_event(0)) + last_event = self.event_storage.get_last_event() + last_group_id = self.event_storage.get_last_group_id() + + assert events == [] + assert last_event is None + assert last_group_id is None + + def test_clear_events_full_database(self): + n_events = 10 + expected_last_group_id = 4 + expected_node_state = NodeState.SYNC + + self._populate_events_and_last_group_id(n_events=n_events, last_group_id=4) + self.event_storage.save_node_state(expected_node_state) + self.event_storage.save_event_queue_state(True) + + events = list(self.event_storage.iter_from_event(0)) + last_group_id = self.event_storage.get_last_group_id() + node_state = self.event_storage.get_node_state() + event_queue_state = self.event_storage.get_event_queue_state() + + assert len(events) == n_events + assert last_group_id == expected_last_group_id + assert node_state == expected_node_state + assert event_queue_state is True + + self._test_clear_events() + + node_state = self.event_storage.get_node_state() + event_queue_state = self.event_storage.get_event_queue_state() + + assert node_state == expected_node_state + assert event_queue_state is True + @pytest.mark.skipif(not HAS_ROCKSDB, reason='requires python-rocksdb') class EventStorageRocksDBTest(EventStorageBaseTest): diff --git a/tests/event/test_simulation.py b/tests/event/test_simulation.py new file mode 100644 index 000000000..e90a8a43f --- /dev/null +++ b/tests/event/test_simulation.py @@ -0,0 +1,405 @@ +# 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 typing import List +from unittest.mock import Mock + +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.utils import zip_chunkify + +SIMULATOR_SEED = 9922163193306864793 + + +def test_only_load(): + simulator = Simulator(seed=SIMULATOR_SEED) + simulator.start() + + main_peer_id = PeerId() + main_manager = simulator.create_peer( + peer_id=main_peer_id, + full_verification=False, + event_ws_factory=Mock() + ) + 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() + ), + 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 expected_events == actual_events + + +def test_single_chain_one_block(): + simulator = Simulator(seed=SIMULATOR_SEED) + simulator.start() + + main_peer_id = PeerId() + main_manager = simulator.create_peer( + peer_id=main_peer_id, + full_verification=False, + event_ws_factory=Mock() + ) + 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() + ), + 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) + + +def test_single_chain_blocks_and_transactions(): + simulator = Simulator(seed=SIMULATOR_SEED) + simulator.start() + + main_peer_id = PeerId() + main_manager = simulator.create_peer( + peer_id=main_peer_id, + full_verification=False, + event_ws_factory=Mock() + ) + 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 + 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) + + +def test_reorg(): + simulator = Simulator(seed=SIMULATOR_SEED) + simulator.start() + + main_peer_id = PeerId() + main_manager = simulator.create_peer( + peer_id=main_peer_id, + full_verification=False, + event_ws_factory=Mock() + ) + 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 + 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) diff --git a/tests/others/test_cli_builder.py b/tests/others/test_cli_builder.py index ee0fd74b5..a4cbc09bb 100644 --- a/tests/others/test_cli_builder.py +++ b/tests/others/test_cli_builder.py @@ -55,7 +55,7 @@ def test_all_default(self): self.assertNotIn(SyncVersion.V2, manager.connections._sync_factories) self.assertFalse(self.builder._build_prometheus) self.assertFalse(self.builder._build_status) - self.assertIsNone(manager._event_manager) + self.assertFalse(manager._enable_event_queue) @pytest.mark.skipif(not HAS_ROCKSDB, reason='requires python-rocksdb') def test_cache_storage(self): @@ -152,7 +152,6 @@ def test_event_queue_with_rocksdb_storage(self): self.assertIsInstance(manager._event_manager, EventManager) self.assertIsInstance(manager._event_manager._event_storage, EventRocksDBStorage) self.assertIsInstance(manager._event_manager._event_ws_factory, EventWebsocketFactory) - self.assertFalse(manager._event_manager.emit_load_events) def test_event_queue_with_memory_storage(self): manager = self._build(['--x-enable-event-queue', '--memory-storage']) @@ -160,16 +159,7 @@ def test_event_queue_with_memory_storage(self): self.assertIsInstance(manager._event_manager, EventManager) self.assertIsInstance(manager._event_manager._event_storage, EventMemoryStorage) self.assertIsInstance(manager._event_manager._event_ws_factory, EventWebsocketFactory) - self.assertFalse(manager._event_manager.emit_load_events) def test_event_queue_with_full_verification(self): args = ['--x-enable-event-queue', '--memory-storage', '--x-full-verification'] self._build_with_error(args, '--x-full-verification cannot be used with --x-enable-event-queue') - - def test_event_queue_with_emit_load_events(self): - manager = self._build(['--x-enable-event-queue', '--memory-storage', '--x-emit-load-events']) - - self.assertIsInstance(manager._event_manager, EventManager) - self.assertIsInstance(manager._event_manager._event_storage, EventMemoryStorage) - self.assertIsInstance(manager._event_manager._event_ws_factory, EventWebsocketFactory) - self.assertTrue(manager._event_manager.emit_load_events) diff --git a/tests/utils.py b/tests/utils.py index 3d6a77bbd..c9326efb5 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -748,8 +748,13 @@ def zip_chunkify(flat_list: List[T], chunked_list: List[List[T]]) -> Iterator[Tu >>> list(zip_chunkify([0, 2, 4, 6, 8, 10, 12], [[1], [3, 5], [7], [9, 11, 13]])) [([0], [1]), ([2, 4], [3, 5]), ([6], [7]), ([8, 10, 12], [9, 11, 13])] """ - if len(flat_list) != sum(map(len, chunked_list)): - raise ValueError('lists should have the same amount of items') + + flat_list_len = len(flat_list) + chunked_list_len = sum(map(len, chunked_list)) + + if flat_list_len != chunked_list_len: + raise ValueError(f'lists should have the same amount of items. ' + f'{flat_list_len} (flat) != {chunked_list_len} (chunked)') flat_iter = iter(flat_list)