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

Commit

Permalink
Merge from master (#697)
Browse files Browse the repository at this point in the history
* Sync to management SC (#689)

* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>

* Update to Neo v3.0.0-CI01105 (#692)

* Update to Neo v3.0.0-CI01015

* Update neo-cli.csproj

* Update name nep17 (#695)

* Fix Parse manifestFilePath

* merge master

* Update Name for NEP17

* fix format

* show error message

* fix

* fix

Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: cloud8little <34291844+cloud8little@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 18, 2020
1 parent 9d154fc commit 726a306
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions neo-cli/CLI/MainService.NEP17.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
using System;
using System.Globalization;
using System.Linq;
using Neo.SmartContract;
using Neo.SmartContract.Native;
using Neo.Ledger;

namespace Neo.CLI
{
Expand Down Expand Up @@ -88,9 +91,10 @@ private void OnBalanceOfCommand(UInt160 tokenHash, UInt160 address)
[ConsoleCommand("name", Category = "NEP17 Commands")]
private void OnNameCommand(UInt160 tokenHash)
{
if (!OnInvokeWithResult(tokenHash, "name", out StackItem result, null)) return;

Console.WriteLine($"Result : {((PrimitiveType)result).GetString()}");
var snapshot = Blockchain.Singleton.GetSnapshot();
ContractState contract = NativeContract.Management.GetContract(snapshot, tokenHash);
if (contract == null) Console.WriteLine($"Contract hash not exist: {tokenHash}");
else Console.WriteLine($"Result : {contract.Manifest.Name.ToString()}");
}

/// <summary>
Expand Down

0 comments on commit 726a306

Please sign in to comment.