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

Update MainService.Contracts.cs #769

Merged
merged 3 commits into from
Apr 20, 2021
Merged

Conversation

chenzhitong
Copy link
Member

close #768

@chenzhitong chenzhitong requested a review from ProDog April 20, 2021 08:12
Copy link
Contributor

@ProDog ProDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it with the original code?

            if (!NoWallet() && sender != null)
            {
                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();
            }

shargon
shargon previously approved these changes Apr 20, 2021
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested?

@ProDog
Copy link
Contributor

ProDog commented Apr 20, 2021

Tested OK.

@shargon shargon merged commit f2c96eb into neo-project:master Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When signerAccounts is empty, the signer should be added by default
3 participants