From 2aec9a5e920ab5a8c14df7d35bf10f14fa5abb33 Mon Sep 17 00:00:00 2001 From: Christopher Schuchardt Date: Sun, 14 Jan 2024 04:47:04 -0500 Subject: [PATCH 1/3] Delete src/Neo.CLI/Properties/launchSettings.json --- src/Neo.CLI/Properties/launchSettings.json | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/Neo.CLI/Properties/launchSettings.json diff --git a/src/Neo.CLI/Properties/launchSettings.json b/src/Neo.CLI/Properties/launchSettings.json deleted file mode 100644 index 806e8b05de..0000000000 --- a/src/Neo.CLI/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "Neo.CLI": { - "commandName": "Project", - "workingDirectory": "C:\\Users\\Chris\\Projects\\cschuchardt88\\neo\\src\\Neo.CLI\\bin\\Debug\\net7.0\\publish" - } - } -} \ No newline at end of file From faeac84b806c9ba2b1a4995f41a607490dd2b383 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sun, 14 Jan 2024 18:31:19 +0800 Subject: [PATCH 2/3] Update src/Neo.CLI/CLI/MainService.Plugins.cs --- src/Neo.CLI/CLI/MainService.Plugins.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo.CLI/CLI/MainService.Plugins.cs b/src/Neo.CLI/CLI/MainService.Plugins.cs index 8bbca2a299..311687fe02 100644 --- a/src/Neo.CLI/CLI/MainService.Plugins.cs +++ b/src/Neo.CLI/CLI/MainService.Plugins.cs @@ -34,7 +34,7 @@ partial class MainService /// /// Plugin name [ConsoleCommand("install", Category = "Plugin Commands")] - private void OnInstallCommandAsync(string pluginName) + private void OnInstallCommand(string pluginName) { if (PluginExists(pluginName)) { From d018ccd4d646d6c0b9d0d791f62bb29d7f12fc05 Mon Sep 17 00:00:00 2001 From: Christopher Schuchardt Date: Sun, 14 Jan 2024 08:30:56 -0500 Subject: [PATCH 3/3] `Bug Fix`| Signers not being set in `neo-cli` with Invoke Command (#3090) * Fixed #3088 * Removed variable --- .gitignore | 1 + src/Neo.CLI/CLI/MainService.Contracts.cs | 30 ++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index cb49b769de..1358af3bde 100644 --- a/.gitignore +++ b/.gitignore @@ -256,3 +256,4 @@ paket-files/ PublishProfiles /.vscode +launchSettings.json diff --git a/src/Neo.CLI/CLI/MainService.Contracts.cs b/src/Neo.CLI/CLI/MainService.Contracts.cs index b2a90dda11..94fbe32f89 100644 --- a/src/Neo.CLI/CLI/MainService.Contracts.cs +++ b/src/Neo.CLI/CLI/MainService.Contracts.cs @@ -133,21 +133,27 @@ private void OnInvokeCommand(UInt160 scriptHash, string operation, JArray? contr { var gas = new BigDecimal(maxGas, NativeContract.GAS.Decimals); Signer[] signers = Array.Empty(); - if (!NoWallet() && sender != null) + if (!NoWallet()) { - if (signerAccounts == null) - signerAccounts = new UInt160[1] { sender }; - else if (signerAccounts.Contains(sender) && signerAccounts[0] != sender) - { - var signersList = signerAccounts.ToList(); - signersList.Remove(sender); - signerAccounts = signersList.Prepend(sender).ToArray(); - } - else if (!signerAccounts.Contains(sender)) + if (sender == null) + sender = CurrentWallet!.GetDefaultAccount()?.ScriptHash; + + if (sender != null) { - signerAccounts = signerAccounts.Prepend(sender).ToArray(); + if (signerAccounts == null) + signerAccounts = new UInt160[1] { sender }; + else if (signerAccounts.Contains(sender) && signerAccounts[0] != sender) + { + var signersList = signerAccounts.ToList(); + signersList.Remove(sender); + signerAccounts = signersList.Prepend(sender).ToArray(); + } + else if (!signerAccounts.Contains(sender)) + { + signerAccounts = signerAccounts.Prepend(sender).ToArray(); + } + signers = signerAccounts.Select(p => new Signer() { Account = p, Scopes = WitnessScope.CalledByEntry }).ToArray(); } - signers = signerAccounts.Select(p => new Signer() { Account = p, Scopes = WitnessScope.CalledByEntry }).ToArray(); } Transaction tx = new Transaction