"""
----------------------v1.0.0----------------------
  ____                 _      _           _       
 / ___| ___   ___   __| | ___| |__   __ _(_)_ __  
| |  _ / _ \ / _ \ / _` |/ __| '_ \ / _` | | '_ \ 
| |_| | (_) | (_) | (_| | (__| | | | (_| | | | | |
 \____|\___/ \___/ \__,_|\___|_| |_|\__,_|_|_| |_|

------------------Ryan & Teuntje------------------
"""
from helpers.DatabaseHelper import DatabaseHelper
from helpers.MenuHelper import MenuHelper
from helpers import UtilityHelper as utilityHelper
from time import sleep

if __name__ == "__main__":

    utilityHelper.clearScreen()
    utilityHelper.printLogo()
    # start db connection
    db = DatabaseHelper("../data/goodchain.db")
    db.checkMigrations()

    # check ledger and pool file
    utilityHelper.createFile("../data/ledger.dat")
    utilityHelper.createFile("../data/transaction_pool.dat")

    sleep(1)

    # start menu
    menu = MenuHelper(db)
    while(True):
        menu.runStartMenu()
        
        if menu.user != None:
            menu.runUserMainMenu()