Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Added blockchain show block/transactions/contracts commands #905

Merged
merged 22 commits into from
Nov 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions neo-cli/CLI/MainService.Blockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,25 @@ public void OnShowTransactionCommand(UInt256 hash)
{
foreach (var attribute in tx.Transaction.Attributes)
{
ConsoleHelper.Info("", " Type: ", $"{attribute.Type}");
ConsoleHelper.Info("", " AllowMultiple: ", $"{attribute.AllowMultiple}");
ConsoleHelper.Info("", " Size: ", $"{attribute.Size} Byte(s)");
if (attribute is Conflicts c)
{
ConsoleHelper.Info("", " Type: ", $"{c.Type}");
ConsoleHelper.Info("", " Hash: ", $"{c.Hash}");
ConsoleHelper.Info("", " Size: ", $"{c.Size} Byte(s)");
}
else if (attribute is OracleResponse o)
{
ConsoleHelper.Info("", " Type: ", $"{o.Type}");
ConsoleHelper.Info("", " Id: ", $"{o.Id}");
ConsoleHelper.Info("", " Code: ", $"{o.Code}");
ConsoleHelper.Info("", " Result: ", $"{Convert.ToBase64String(o.Result.Span)}");
ConsoleHelper.Info("", " Size: ", $"{o.Size} Byte(s)");
}
else
Jim8y marked this conversation as resolved.
Show resolved Hide resolved
{
ConsoleHelper.Info("", " Type: ", $"{attribute.Type}");
ConsoleHelper.Info("", " Size: ", $"{attribute.Size} Byte(s)");
}
cschuchardt88 marked this conversation as resolved.
Show resolved Hide resolved
}
}
ConsoleHelper.Info();
Expand Down