Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Add] IEquatable to Signer #3571

Merged
merged 17 commits into from
Nov 20, 2024

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Nov 9, 2024

Change Log

  • Added IEquatable to Signer class
  • Added Unit Tests for IEquatable on Signer class

Needs #3573

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Test_IEquatable

Test Configuration:

  • Unit Tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules


public override bool Equals(object obj)
{
if (obj == null)
Copy link
Member

Choose a reason for hiding this comment

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

== null already done in is sentence

Copy link
Member Author

Choose a reason for hiding this comment

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

== checks for null and sends to this method.

@cschuchardt88 cschuchardt88 added the Blocked This issue can't be worked at the moment label Nov 11, 2024
@shargon shargon removed the Blocked This issue can't be worked at the moment label Nov 11, 2024
@Jim8y Jim8y requested review from nan01ab, Jim8y and shargon November 13, 2024 03:29
@Jim8y Jim8y added the Blocked This issue can't be worked at the moment label Nov 13, 2024
@Jim8y Jim8y removed the Blocked This issue can't be worked at the moment label Nov 13, 2024
Jim8y
Jim8y previously approved these changes Nov 13, 2024
@Jim8y Jim8y requested review from shargon and AnnaShaleva November 15, 2024 16:00
if (other is null) return false;
return Account == other.Account &&
Scopes == other.Scopes &&
AllowedContracts.AsSpan().SequenceEqual(other.AllowedContracts.AsSpan()) &&
Copy link
Member

@shargon shargon Nov 16, 2024

Choose a reason for hiding this comment

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

Serialize the object for compare seems very weird, and slow, i will fix it tomorrow

Copy link
Contributor

@nan01ab nan01ab Nov 17, 2024

Choose a reason for hiding this comment

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

Serialize the object for compare seems very weird, and slow, i will fix it tomorrow

What is serialized?

AllowedContracts and AllowedGroups are array.

Copy link
Member Author

@cschuchardt88 cschuchardt88 Nov 19, 2024

Choose a reason for hiding this comment

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

Serialize the object for compare seems very weird, and slow, i will fix it tomorrow

Span is faster and we don't have to check for null.

@Jim8y Jim8y requested a review from shargon November 18, 2024 15:19
@NGDAdmin NGDAdmin merged commit 842fa52 into neo-project:master Nov 20, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants