From 9359f28161be8a76d5a521d744826022c87a6291 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 28 May 2021 15:46:41 +0300 Subject: [PATCH] [#525] ir/container: Compare owner IDs via Equal method In recent change of API Go library `owner.ID.Equal` signature was implemented. Replace the comparison of string representations with `Equal` method call and remove related TODOs. Signed-off-by: Leonard Lyubich --- pkg/innerring/processors/container/common.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/innerring/processors/container/common.go b/pkg/innerring/processors/container/common.go index 107690372..98e953aff 100644 --- a/pkg/innerring/processors/container/common.go +++ b/pkg/innerring/processors/container/common.go @@ -60,8 +60,7 @@ func (cp *Processor) checkKeyOwnership(ownerIDSrc ownerIDSource, key *keys.Publi return err } - // TODO: need Equal method on owner.ID - if ownerIDSrc.OwnerID().String() == owner.NewIDFromNeo3Wallet(w).String() { + if ownerIDSrc.OwnerID().Equal(owner.NewIDFromNeo3Wallet(w)) { return nil } @@ -89,8 +88,7 @@ func (cp *Processor) checkKeyOwnershipWithToken(ownerIDSrc ownerIDSource, key *k } // check owner - // TODO: need Equal method on owner.ID - if token.OwnerID().String() != ownerIDSrc.OwnerID().String() { + if !token.OwnerID().Equal(ownerIDSrc.OwnerID()) { return errors.New("owner differs with token owner") }