2023-09-19 09:51:59 +00:00
|
|
|
|
namespace GethPlugin
|
|
|
|
|
{
|
|
|
|
|
public interface IHasEthAddress
|
|
|
|
|
{
|
2023-09-20 08:13:29 +00:00
|
|
|
|
EthAddress EthAddress { get; }
|
2023-09-19 09:51:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 08:13:29 +00:00
|
|
|
|
public class EthAddress
|
2023-09-19 09:51:59 +00:00
|
|
|
|
{
|
|
|
|
|
public EthAddress(string address)
|
|
|
|
|
{
|
2023-12-20 14:56:03 +00:00
|
|
|
|
Address = address.ToLowerInvariant();
|
2023-09-19 09:51:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Address { get; }
|
2023-10-22 08:10:52 +00:00
|
|
|
|
|
2023-12-20 10:34:23 +00:00
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
|
{
|
|
|
|
|
return obj is EthAddress address &&
|
|
|
|
|
Address == address.Address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(Address);
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 08:10:52 +00:00
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Address;
|
|
|
|
|
}
|
2023-09-19 09:51:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|