diff --git a/src/Neo/Network/P2P/Payloads/Signer.cs b/src/Neo/Network/P2P/Payloads/Signer.cs index 9a68640880..79065408f4 100644 --- a/src/Neo/Network/P2P/Payloads/Signer.cs +++ b/src/Neo/Network/P2P/Payloads/Signer.cs @@ -192,14 +192,14 @@ void IInteroperable.FromStackItem(VM.Types.StackItem stackItem) VM.Types.StackItem IInteroperable.ToStackItem(ReferenceCounter referenceCounter) { - return new VM.Types.Array(referenceCounter, new VM.Types.StackItem[] - { + return new VM.Types.Array(referenceCounter, + [ Account.ToArray(), (byte)Scopes, - new VM.Types.Array(referenceCounter, AllowedContracts.Select(u => new VM.Types.ByteString(u.ToArray()))), - new VM.Types.Array(referenceCounter, AllowedGroups.Select(u => new VM.Types.ByteString(u.ToArray()))), - new VM.Types.Array(referenceCounter, Rules.Select(u => u.ToStackItem(referenceCounter))) - }); + Scopes.HasFlag(WitnessScope.CustomContracts) ? new VM.Types.Array(referenceCounter, AllowedContracts.Select(u => new VM.Types.ByteString(u.ToArray()))) : new VM.Types.Array(referenceCounter), + Scopes.HasFlag(WitnessScope.CustomGroups) ? new VM.Types.Array(referenceCounter, AllowedGroups.Select(u => new VM.Types.ByteString(u.ToArray()))) : new VM.Types.Array(referenceCounter), + Scopes.HasFlag(WitnessScope.WitnessRules) ? new VM.Types.Array(referenceCounter, Rules.Select(u => u.ToStackItem(referenceCounter))) : new VM.Types.Array(referenceCounter) + ]); } } }