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

Commit

Permalink
Update MainService.Contracts.cs (#769)
Browse files Browse the repository at this point in the history
* Update MainService.Contracts.cs

* format

* ProDog's feedback
  • Loading branch information
chenzhitong authored Apr 20, 2021
1 parent ff14f44 commit f2c96eb
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions neo-cli/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,19 @@ private void OnInvokeCommand(UInt160 scriptHash, string operation, JArray contra
{
var gas = new BigDecimal(maxGas, NativeContract.GAS.Decimals);
Signer[] signers = Array.Empty<Signer>();
if (signerAccounts != null && !NoWallet())
if (!NoWallet() && sender != null)
{
if (sender != null)
if (signerAccounts == null)
signerAccounts = new UInt160[1] { sender };
else if (signerAccounts.Contains(sender) && signerAccounts[0] != sender)
{
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();
}
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();
}
Expand Down

0 comments on commit f2c96eb

Please sign in to comment.