protected override void ExecuteCommand(string[] args) { // determine if id or hash // fetch transaction in database var signed = LedgerService.LedgerManager.LastLedger.Ledger.Block.Transactions.First(); DisplayFormatter.DisplayTransaction(signed); }
protected override void ExecuteCommand(string[] args) { // determine if id or hash // fetch block in database var block = LedgerService.LedgerManager.LastLedger.Ledger.Block; var height = block.LedgerHeight; var hash = block.Hash; var count = block.Transactions.Count(); var fees = block.FeeTransactionIndex.HasValue ? Amount.ToWholeDecimal(block.Transactions.ElementAt(block.FeeTransactionIndex.Value).Transaction.Outputs[0].Amount) : 0; Console.WriteLine("------------------------------"); Console.WriteLine($"Block Height {height} Hash {hash.ToBase64()} Transactions {count} Fees {fees} CAS"); foreach (var transaction in block.Transactions) { DisplayFormatter.DisplayTransaction(transaction); } }