async def METHOD_NAME(
    mocker,
    mock_config: Config,
    session_factory: DbSessionFactory,
    test_storage_service: StorageService,
    payload: MessageEventPayload,
):
    chain_data_service = ChainDataService(
        session_factory=session_factory, storage_service=mocker.AsyncMock()
    )
    pending_tx_processor = PendingTxProcessor(
        session_factory=session_factory,
        storage_service=test_storage_service,
        message_handler=MessageHandler(
            session_factory=session_factory,
            chain_service=mocker.AsyncMock(),
            storage_service=test_storage_service,
            config=mock_config,
        ),
    )
    pending_tx_processor.chain_data_service = chain_data_service
    tx = ChainTxDb(
        hash="oorMNgusX6RxZ4NhzYriVDN8HDeMBNkjD3E8kx9a7j7dRRDGkzz",
        chain=Chain.TEZOS,
        height=584664,
        datetime=timestamp_to_datetime(1668611900),
        publisher="KT1BfL57oZfptdtMFZ9LNakEPvuPPA2urdSW",
        protocol=ChainSyncProtocol.SMART_CONTRACT,
        protocol_version=1,
        content=payload.dict(),
    )
    pending_tx = PendingTxDb(tx=tx)
    with session_factory() as session:
        session.add(pending_tx)
        session.commit()
    await pending_tx_processor.handle_pending_tx(pending_tx=pending_tx)
    with session_factory() as session:
        pending_txs = session.execute(select(PendingTxDb)).scalars().all()
        assert not pending_txs
        pending_messages = list(session.execute(select(PendingMessageDb)).scalars())
        assert len(pending_messages) == 1
        pending_message_db = pending_messages[0]
        assert pending_message_db.signature is None
        assert not pending_message_db.check_message
        assert pending_message_db.sender == payload.addr
        if payload.message_type == "STORE_IPFS":
            assert pending_message_db.type == MessageType.store
        else:
            assert pending_message_db.type == MessageType(payload.message_type)
        message_status_db = (
            session.execute(
                select(MessageStatusDb).where(
                    MessageStatusDb.item_hash == pending_message_db.item_hash
                )
            )
        ).scalar_one()
        assert message_status_db.status == MessageStatus.PENDING