Skip to content

Commit 3b82ce4

Browse files
Fix/address dictionary (#254)
* Added GetHashCode override for Address class so that we can use it in Dictionaries as a key and not encounter issues with value comparison * Increment package version
1 parent 5fcaa7d commit 3b82ce4

File tree

1 file changed

+6
-1
lines changed
  • Packages/Sequence-Unity/Sequence/SequenceSDK/Ethereum/Address

1 file changed

+6
-1
lines changed

Packages/Sequence-Unity/Sequence/SequenceSDK/Ethereum/Address/Address.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public override bool Equals(object obj)
4040
}
4141

4242
Address address = (Address)obj;
43-
return this.Value == address.Value;
43+
return Value.Equals(address.Value, StringComparison.OrdinalIgnoreCase);
44+
}
45+
46+
public override int GetHashCode()
47+
{
48+
return Value.ToLowerInvariant().GetHashCode();
4449
}
4550
}
4651

0 commit comments

Comments
 (0)