From 00946fdec9d47570fbdf06b4dc3bf521e91be391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=97=E5=90=8C?= Date: Thu, 15 Oct 2020 15:12:41 +0800 Subject: [PATCH] invoke* use base64 script (#673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 打开钱包当文件不存在时错误提示更友好 * Show wallet height when executing "show state" command. Keep in line with neo-gui. * fixed bug * 修复Bug * optimize * fix * invoke* use base64 script Co-authored-by: Erik Zhang --- neo-cli/CLI/Helper.cs | 2 ++ neo-cli/CLI/MainService.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/neo-cli/CLI/Helper.cs b/neo-cli/CLI/Helper.cs index 391fd0d0e..b1759d746 100644 --- a/neo-cli/CLI/Helper.cs +++ b/neo-cli/CLI/Helper.cs @@ -10,5 +10,7 @@ public static bool IsYes(this string input) return input == "yes" || input == "y"; } + + public static string ToBase64String(this byte[] input) => System.Convert.ToBase64String(input); } } diff --git a/neo-cli/CLI/MainService.cs b/neo-cli/CLI/MainService.cs index b9f6f38e2..a08fecc4b 100644 --- a/neo-cli/CLI/MainService.cs +++ b/neo-cli/CLI/MainService.cs @@ -480,7 +480,7 @@ private void SendTransaction(byte[] script, UInt160 account = null) try { Transaction tx = CurrentWallet.MakeTransaction(script, account, signers); - Console.WriteLine($"Invoking script with: '{tx.Script.ToHexString()}'"); + Console.WriteLine($"Invoking script with: '{tx.Script.ToBase64String()}'"); using (ApplicationEngine engine = ApplicationEngine.Run(tx.Script, container: tx)) { @@ -529,7 +529,7 @@ private StackItem OnInvokeWithResult(UInt160 scriptHash, string operation, IVeri { scriptBuilder.EmitAppCall(scriptHash, operation, parameters.ToArray()); script = scriptBuilder.ToArray(); - Console.WriteLine($"Invoking script with: '{script.ToHexString()}'"); + Console.WriteLine($"Invoking script with: '{script.ToBase64String()}'"); } if (verificable is Transaction tx)