public ConsumerRocksDbProvider(string basePath, IDbConfig dbConfig, ILogManager logManager)
 {
     ConsumerDepositApprovalsDb = new ConsumerDepositApprovalsRocksDb(basePath, dbConfig, logManager);
     ConsumerReceiptsDb         = new ConsumerReceiptsRocksDb(basePath, dbConfig, logManager);
     ConsumerSessionsDb         = new ConsumerSessionsRocksDb(basePath, dbConfig, logManager);
     DepositsDb = new DepositsRocksDb(basePath, dbConfig, logManager);
 }
        public void Init(string path)
        {
            var dbOnTheRocks           = new ConsumerDepositApprovalsRocksDb(path, new DbConfig(), LimboLogs.Instance);
            var depositApprovalsBytes  = dbOnTheRocks.GetAll();
            var depositApprovalDecoder = new DepositApprovalDecoder();
            var depositApprovals       = depositApprovalsBytes
                                         .Select(b => depositApprovalDecoder.Decode(b.Value.AsRlpStream()));

            var window = new Window("Consumer deposit approvals")
            {
                X = 0, Y = 10, Width = Dim.Fill(), Height = Dim.Fill()
            };

            if (!depositApprovals.Any())
            {
                MessageBox.Query(40, 7, "Consumer deposit approvals", "No data." +
                                 $"{Environment.NewLine}(ESC to close)");
                window.FocusPrev();
                return;
            }

            var y = 1;

            foreach (var depositApproval in depositApprovals)
            {
                var depositApprovalBtn = new Button(1, y++, $"AssetName: {depositApproval.AssetName}," +
                                                    $"State: {depositApproval.State}");

                depositApprovalBtn.Clicked = () =>
                {
                    var depositApprovalDetailsWindow = new Window("Deposit approval details")
                    {
                        X = 0, Y = 10, Width = Dim.Fill(), Height = Dim.Fill()
                    };
                    Application.Top.Add(depositApprovalDetailsWindow);
                    var serializer         = new EthereumJsonSerializer();
                    var depositApprovalLbl = new Label(1, 1, serializer.Serialize(depositApproval, true));
                    depositApprovalDetailsWindow.Add(depositApprovalLbl);
                    Application.Run(depositApprovalDetailsWindow);
                };
                window.Add(depositApprovalBtn);
            }

            Application.Top.Add(window);
            Application.Run(window);
        }