[#101] Add Equals for Address

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-07-07 08:47:30 +03:00
parent fe35373d8f
commit e65e4bfe8e

View file

@ -169,3 +169,11 @@ func (x *Address) DecodeString(s string) error {
func (x Address) String() string {
return x.EncodeToString()
}
// Equals defines a comparison relation between two Address's instances.
//
// Note that comparison using '==' operator is not recommended since it MAY result
// in loss of compatibility.
func (x Address) Equals(other Address) bool {
return x.obj.Equals(other.obj) && x.cnr.Equals(other.cnr)
}