From 3be2b5326612acd956d4edcff8326003e9710557 Mon Sep 17 00:00:00 2001 From: ZhangHaoqiang Date: Wed, 6 May 2020 16:15:12 +0800 Subject: [PATCH] Show `ScriptHash` in `list address` (#566) * Update MainService.Wallet.cs * Update MainService.cs * Uppercase * Add vote command * Remove vote commands. * Update MainService.cs * fix UT Co-authored-by: Shargon Co-authored-by: Luchuan --- .github/workflows/test-neo-cli.expect | 2 +- neo-cli/CLI/MainService.Wallet.cs | 3 ++- neo-cli/CLI/MainService.cs | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-neo-cli.expect b/.github/workflows/test-neo-cli.expect index ff1f1ba88..d726413b3 100755 --- a/.github/workflows/test-neo-cli.expect +++ b/.github/workflows/test-neo-cli.expect @@ -36,7 +36,7 @@ expect { } expect { - "address:" { } + " Address:" { } "error" { exit 2 } timeout { exit 1 } } diff --git a/neo-cli/CLI/MainService.Wallet.cs b/neo-cli/CLI/MainService.Wallet.cs index 4664f9ce5..0eb2115a9 100644 --- a/neo-cli/CLI/MainService.Wallet.cs +++ b/neo-cli/CLI/MainService.Wallet.cs @@ -311,7 +311,8 @@ private void OnListAddressCommand() type = "Deployed-Nonstandard"; } - Console.WriteLine($"{contract.Address}\t{type}"); + Console.WriteLine($"{" Address: "}{contract.Address}\t{type}"); + Console.WriteLine($"{"ScriptHash: "}{contract.ScriptHash}\n"); } } } diff --git a/neo-cli/CLI/MainService.cs b/neo-cli/CLI/MainService.cs index b11ab2d87..b80a39bc6 100644 --- a/neo-cli/CLI/MainService.cs +++ b/neo-cli/CLI/MainService.cs @@ -140,8 +140,9 @@ public void CreateWallet(string path, string password) { UserWallet wallet = UserWallet.Create(path, password); WalletAccount account = wallet.CreateAccount(); - 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()}"); + Console.WriteLine($"ScriptHash: {account.ScriptHash}"); CurrentWallet = wallet; } break; @@ -151,8 +152,9 @@ public void CreateWallet(string path, string password) wallet.Unlock(password); WalletAccount account = wallet.CreateAccount(); wallet.Save(); - 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()}"); + Console.WriteLine($"ScriptHash: {account.ScriptHash}"); CurrentWallet = wallet; } break;