Skip to content

Commit

Permalink
Merge branch 'master' into HF_Echidna
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon authored Nov 20, 2024
2 parents 331541a + cd6667e commit eb96d14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Neo/NeoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void EnsureStopped(IActorRef actor)
using Inbox inbox = Inbox.Create(ActorSystem);
inbox.Watch(actor);
ActorSystem.Stop(actor);
inbox.Receive(TimeSpan.FromMinutes(5));
inbox.Receive(TimeSpan.FromSeconds(30));
}

/// <summary>
Expand Down
26 changes: 17 additions & 9 deletions src/Neo/Network/P2P/Payloads/Signer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,26 @@ public bool Equals(Signer other)
{
if (ReferenceEquals(this, other))
return true;

if (other is null) return false;
return Account == other.Account &&
Scopes == other.Scopes &&
AllowedContracts.AsSpan().SequenceEqual(other.AllowedContracts.AsSpan()) &&
AllowedGroups.AsSpan().SequenceEqual(other.AllowedGroups.AsSpan()) &&
Rules.AsEnumerable().SequenceEqual(other.Rules.AsEnumerable());
if (Account != other.Account || Scopes != other.Scopes)
return false;

if (Scopes.HasFlag(WitnessScope.CustomContracts) && !AllowedContracts.SequenceEqual(other.AllowedContracts))
return false;

if (Scopes.HasFlag(WitnessScope.CustomGroups) && !AllowedGroups.SequenceEqual(other.AllowedGroups))
return false;

if (Scopes.HasFlag(WitnessScope.WitnessRules) && !Rules.SequenceEqual(other.Rules))
return false;

return true;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
if (obj == null) return false;
return obj is Signer signerObj && Equals(signerObj);
}

Expand Down Expand Up @@ -137,7 +145,7 @@ public IEnumerable<WitnessRule> GetAllRules()
}
if (Scopes.HasFlag(WitnessScope.CustomContracts))
{
foreach (UInt160 hash in AllowedContracts)
foreach (var hash in AllowedContracts)
yield return new WitnessRule
{
Action = WitnessRuleAction.Allow,
Expand All @@ -146,7 +154,7 @@ public IEnumerable<WitnessRule> GetAllRules()
}
if (Scopes.HasFlag(WitnessScope.CustomGroups))
{
foreach (ECPoint group in AllowedGroups)
foreach (var group in AllowedGroups)
yield return new WitnessRule
{
Action = WitnessRuleAction.Allow,
Expand All @@ -155,7 +163,7 @@ public IEnumerable<WitnessRule> GetAllRules()
}
if (Scopes.HasFlag(WitnessScope.WitnessRules))
{
foreach (WitnessRule rule in Rules)
foreach (var rule in Rules)
yield return rule;
}
}
Expand Down

0 comments on commit eb96d14

Please sign in to comment.