@staticmethod<EOL><INDENT>def blocks(delegate_pubkey=None, max_timestamp=None):<DEDENT>
if not delegate_pubkey:<EOL><INDENT>delegate_pubkey = c.DELEGATE['<STR_LIT>']<EOL><DEDENT>if max_timestamp:<EOL><INDENT>max_timestamp_sql = """<STR_LIT>""".format(max_timestamp)<EOL><DEDENT>else:<EOL><INDENT>max_timestamp_sql = '<STR_LIT>'<EOL><DEDENT>qry = DbCursor().execute_and_fetchall("""<STR_LIT>""".format(<EOL>max_timestamp_sql,<EOL>delegate_pubkey))<EOL>Block = namedtuple('<STR_LIT>',<EOL>'<STR_LIT>')<EOL>block_list = []<EOL>for block in qry:<EOL><INDENT>block_value = Block(timestamp=block[<NUM_LIT:0>],<EOL>height=block[<NUM_LIT:1>],<EOL>id=block[<NUM_LIT:2>],<EOL>totalFee=block[<NUM_LIT:3>],<EOL>reward=block[<NUM_LIT:4>])<EOL>block_list.append(block_value)<EOL><DEDENT>return block_list<EOL>
returns a list of named tuples of all blocks forged by a delegate.
        if delegate_pubkey is not specified, set_delegate needs to be called in advance.
        max_timestamp can be configured to retrieve blocks up to a certain timestamp.