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

Show address in list key command #585

Merged
merged 13 commits into from
May 13, 2020
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Blockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private void OnExportBlocksStartCountCommand(uint start, uint count = uint.MaxVa
{
if (Blockchain.Singleton.Height < start)
{
Console.WriteLine("error: invalid start height.");
Console.WriteLine("Error: invalid start height.");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void OnInvokeCommand(UInt160 scriptHash, string operation, JArray contra
Console.WriteLine("Error: insufficient balance.");
return;
}
if (!ReadUserInput("relay tx(no|yes)").IsYes())
if (!ReadUserInput("Relay tx(no|yes)").IsYes())
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.NEP5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void OnTransferCommand(UInt160 tokenHash, UInt160 to, decimal amount)
Console.WriteLine("Error: insufficient balance.");
return;
}
if (!ReadUserInput("relay tx(no|yes)").IsYes())
if (!ReadUserInput("Relay tx(no|yes)").IsYes())
{
return;
}
Expand Down
3 changes: 1 addition & 2 deletions neo-cli/CLI/MainService.Vote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ private void OnGetCandidatesCommand()
{
var value = (VM.Types.Array)item;

Console.Write(((ByteString)value?[0])?.GetSpan().ToHexString());
Console.Write(" ");
Console.Write(((ByteString)value?[0])?.GetSpan().ToHexString() + "\t");
Console.WriteLine(((Integer)value?[1]).ToBigInteger());
}
}
Expand Down
27 changes: 14 additions & 13 deletions neo-cli/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void OnOpenWallet(string path)
string password = ReadUserInput("password", true);
if (password.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
try
Expand All @@ -45,7 +45,7 @@ private void OnOpenWallet(string path)
}
catch (System.Security.Cryptography.CryptographicException)
{
Console.WriteLine($"failed to open file \"{path}\"");
Console.WriteLine($"Failed to open file \"{path}\"");
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ private void OnUpgradeWalletCommand(string path)
string password = ReadUserInput("password", true);
if (password.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
string path_new = Path.ChangeExtension(path, ".json");
Expand Down Expand Up @@ -131,7 +131,7 @@ private void OnCreateAddressCommand(ushort count = 1)
if (CurrentWallet is NEP6Wallet wallet)
wallet.Save();

Console.WriteLine($"export addresses to {path}");
Console.WriteLine($"Export addresses to {path}");
File.WriteAllLines(path, addresses);
}

Expand All @@ -152,7 +152,7 @@ private void OnExportKeyCommand(string path = null, UInt160 scriptHash = null)
string password = ReadUserInput("password", true);
if (password.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
if (!CurrentWallet.VerifyPassword(password))
Expand Down Expand Up @@ -181,13 +181,13 @@ private void OnCreateWalletCommand(string path)
string password = ReadUserInput("password", true);
if (password.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
string password2 = ReadUserInput("password", true);
if (password != password2)
{
Console.WriteLine("error");
Console.WriteLine("Error");
return;
}
if (!File.Exists(path))
Expand Down Expand Up @@ -277,8 +277,8 @@ private void OnImportKeyCommand(string wifOrFile)
{
WalletAccount account = CurrentWallet.CreateAccount(prikey);
Array.Clear(prikey, 0, prikey.Length);
Console.WriteLine($"address: {account.Address}");
Console.WriteLine($" pubkey: {account.GetKey().PublicKey.EncodePoint(true).ToHexString()}");
Console.WriteLine($"Address: {account.Address}");
Console.WriteLine($" Pubkey: {account.GetKey().PublicKey.EncodePoint(true).ToHexString()}");
}
if (CurrentWallet is NEP6Wallet wallet)
wallet.Save();
Expand Down Expand Up @@ -347,7 +347,8 @@ private void OnListKeyCommand()
if (NoWallet()) return;
foreach (KeyPair key in CurrentWallet.GetAccounts().Where(p => p.HasKey).Select(p => p.GetKey()))
{
Console.WriteLine(key.PublicKey);
Console.WriteLine($" Address: {Contract.CreateSignatureContract(key.PublicKey).Address}");
Console.WriteLine($"PublicKey: {key.PublicKey}\n");
}
}

Expand Down Expand Up @@ -394,7 +395,7 @@ private void OnSendCommand(UInt160 asset, UInt160 to, string amount)
string password = ReadUserInput("password", true);
if (password.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
if (!CurrentWallet.VerifyPassword(password))
Expand Down Expand Up @@ -454,7 +455,7 @@ private void OnShowGasCommand()
{
gas += NativeContract.NEO.UnclaimedGas(snapshot, account, snapshot.Height + 1);
}
Console.WriteLine($"unclaimed gas: {new BigDecimal(gas, NativeContract.GAS.Decimals)}");
Console.WriteLine($"Unclaimed gas: {new BigDecimal(gas, NativeContract.GAS.Decimals)}");
}

/// <summary>
Expand All @@ -467,7 +468,7 @@ private void OnChangePasswordCommand()
string oldPassword = ReadUserInput("password", true);
if (oldPassword.Length == 0)
{
Console.WriteLine("cancelled");
Console.WriteLine("Cancelled");
return;
}
if (!CurrentWallet.VerifyPassword(oldPassword))
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public async void Start(string[] args)
}
catch (System.Security.Cryptography.CryptographicException)
{
Console.WriteLine($"failed to open file \"{Settings.Default.UnlockWallet.Path}\"");
Console.WriteLine($"Failed to open file \"{Settings.Default.UnlockWallet.Path}\"");
}
if (Settings.Default.UnlockWallet.StartConsensus && CurrentWallet != null)
{
Expand Down