tests/Node.py
def isTransInBlock(self, transId, blockId):
        """Check if transId is within block identified by blockId"""
        assert(transId)
        assert(isinstance(transId, str))
        assert(blockId)
        assert(isinstance(blockId, int))

        block=self.getBlock(blockId)
        transactions=None
        try:
            transactions=block["transactions"]
        except (AssertionError, TypeError, KeyError) as _:
            Utils.Print("Failed to parse block. %s" % (block))
            raise

        if transactions is not None:
            for trans in transactions:
                assert(trans)
                try:
                    myTransId=trans["trx"]["id"]
                    if transId == myTransId:
                        return True
                except (TypeError, KeyError) as _:
                    Utils.Print("Failed to parse block transactions. %s" % (trans))

        return False
Check if transId is within block identified by blockId
Check if transId is within block identified by blockId
Check if transId is within block identified by blockId
def isTransInBlock(self, transId, blockId):
        assert(transId)
        assert(isinstance(transId, str))
        assert(blockId)
        assert(isinstance(blockId, int))
        block=self.getBlock(blockId)
        transactions=None
        try:
            transactions=block["transactions"]
        except (AssertionError, TypeError, KeyError) as _:
            Utils.Print("Failed to parse block. %s" % (block))
            raise
        if transactions is not None:
            for trans in transactions:
                assert(trans)
                try:
                    myTransId=trans["trx"]["id"]
                    if transId == myTransId:
                        return True
                except (TypeError, KeyError) as _:
                    Utils.Print("Failed to parse block transactions. %s" % (trans))
        return False
def isTransInBlock ( self , transId , blockId ) : assert ( transId ) assert ( isinstance ( transId , str ) ) assert ( blockId ) assert ( isinstance ( blockId , int ) ) block = self . getBlock ( blockId ) transactions = None try : transactions = block [ "transactions" ] except ( AssertionError , TypeError , KeyError ) as _ : Utils . Print ( "Failed to parse block. %s" % ( block ) ) raise if transactions is not None : for trans in transactions : assert ( trans ) try : myTransId = trans [ "trx" ] [ "id" ] if transId == myTransId : return True except ( TypeError , KeyError ) as _ : Utils . Print ( "Failed to parse block transactions. %s" % ( trans ) ) return False
Check if transId is within block identified by blockId
Check if transId is within block identified by blockId
"""Check if transId is within block identified by blockId"""
self
transId
blockId