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

Commit

Permalink
Show ScriptHash in list address (#566)
Browse files Browse the repository at this point in the history
* Update MainService.Wallet.cs

* Update MainService.cs

* Uppercase

* Add vote command

* Remove vote commands.

* Update MainService.cs

* fix UT

Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Luchuan <luchuan@ngd.neo.org>
  • Loading branch information
3 people committed May 6, 2020
1 parent 82033b4 commit 3be2b53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-neo-cli.expect
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ expect {
}

expect {
"address:" { }
" Address:" { }
"error" { exit 2 }
timeout { exit 1 }
}
Expand Down
3 changes: 2 additions & 1 deletion neo-cli/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3be2b53

Please sign in to comment.