@@ -0,0 +1,3445 @@
+import pytest%0A%0Afrom plenum.common.constants import LEDGER_STATUS%0Afrom plenum.common.messages.fields import LedgerIdField, NonNegativeNumberField, %5C%0A    MerkleRootField%0Afrom plenum.common.messages.message_base import MessageBase%0Afrom plenum.test.helper import sdk_send_random_and_check%0Afrom plenum.test.node_catchup.helper import waitNodeDataEquality%0Afrom plenum.test.node_catchup.test_config_ledger import start_stopped_node%0Afrom plenum.test.pool_transactions.helper import %5C%0A    disconnect_node_and_ensure_disconnected%0Afrom plenum.test.test_node import checkNodesConnected%0Afrom plenum.common.types import f%0A%0A%0Adef test_node_catchup_with_new_ls_form(txnPoolNodeSet,%0A                                       looper,%0A                                       sdk_pool_handle,%0A                                       sdk_wallet_steward,%0A                                       tconf,%0A                                       tdir,%0A                                       allPluginsPath):%0A    '''%0A    One node restart and in catchup receive Ledger Status without protocol%0A    version from the one of nodes in pool.%0A    '''%0A    node_to_disconnect = txnPoolNodeSet%5B-1%5D%0A    break_node = txnPoolNodeSet%5B0%5D%0A%0A    sdk_send_random_and_check(looper, txnPoolNodeSet,%0A                              sdk_pool_handle, sdk_wallet_steward, 5)%0A%0A    original_get_ledger_status = break_node.getLedgerStatus%0A%0A    # Path the method getLedgerStatus to%0A    # get_ledger_status_without_protocol_version for sending ledger status%0A    # without protocol version.%0A%0A    def get_ledger_status_without_protocol_version(ledgerId: int):%0A        original_ledger_status = original_get_ledger_status(ledgerId)%0A        return CustomLedgerStatus(original_ledger_status.ledgerId,%0A                                  original_ledger_status.txnSeqNo,%0A                                  original_ledger_status.viewNo,%0A                                  original_ledger_status.ppSeqNo,%0A                                  original_ledger_status.merkleRoot)%0A%0A    break_node.getLedgerStatus = get_ledger_status_without_protocol_version%0A%0A    # restart node%0A    disconnect_node_and_ensure_disconnected(looper,%0A                                            txnPoolNodeSet,%0A                                            node_to_disconnect)%0A    looper.removeProdable(name=node_to_disconnect.name)%0A    sdk_send_random_and_check(looper, txnPoolNodeSet,%0A                              sdk_pool_handle, sdk_wallet_steward,%0A                              2)%0A%0A    # add node_to_disconnect to pool%0A    node_to_disconnect = start_stopped_node(node_to_disconnect, looper, tconf,%0A                                            tdir, allPluginsPath)%0A    txnPoolNodeSet%5B-1%5D = node_to_disconnect%0A    looper.run(checkNodesConnected(txnPoolNodeSet))%0A    waitNodeDataEquality(looper, node_to_disconnect, *txnPoolNodeSet)%0A    sdk_send_random_and_check(looper, txnPoolNodeSet,%0A                              sdk_pool_handle, sdk_wallet_steward, 5)%0A    waitNodeDataEquality(looper, node_to_disconnect, *txnPoolNodeSet)%0A%0A%0Aclass CustomLedgerStatus(MessageBase):%0A    %22%22%22%0A    LedgerStatus class without protocol version%0A    %22%22%22%0A    typename = LEDGER_STATUS%0A    schema = (%0A        (f.LEDGER_ID.nm, LedgerIdField()),%0A        (f.TXN_SEQ_NO.nm, NonNegativeNumberField()),%0A        (f.VIEW_NO.nm, NonNegativeNumberField(nullable=True)),%0A        (f.PP_SEQ_NO.nm, NonNegativeNumberField(nullable=True)),%0A        (f.MERKLE_ROOT.nm, MerkleRootField())%0A    )%0A

Add test for catchup with receiving incorrect ledger status