Skip to content

Commit

Permalink
Merge branch 'add-plugin-config' of https://github.com/cschuchardt88/neo
Browse files Browse the repository at this point in the history
 into add-plugin-config
  • Loading branch information
cschuchardt88 committed Jan 14, 2024
2 parents 2ff2438 + a19f8d7 commit 5adbf45
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,4 @@ paket-files/

PublishProfiles
/.vscode
launchSettings.json
30 changes: 18 additions & 12 deletions src/Neo.CLI/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Signer>();
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
Expand Down
2 changes: 1 addition & 1 deletion src/Neo.CLI/CLI/MainService.Plugins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ partial class MainService
/// </summary>
/// <param name="pluginName">Plugin name</param>
[ConsoleCommand("install", Category = "Plugin Commands")]
private void OnInstallCommandAsync(string pluginName)
private void OnInstallCommand(string pluginName)
{
if (PluginExists(pluginName))
{
Expand Down
8 changes: 0 additions & 8 deletions src/Neo.CLI/Properties/launchSettings.json

This file was deleted.

0 comments on commit 5adbf45

Please sign in to comment.