[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-28 15:46:41 +03:00 committed by Leonard Lyubich
parent 937171911a
commit 9359f28161

View file

@ -60,8 +60,7 @@ func (cp *Processor) checkKeyOwnership(ownerIDSrc ownerIDSource, key *keys.Publi
return err return err
} }
// TODO: need Equal method on owner.ID if ownerIDSrc.OwnerID().Equal(owner.NewIDFromNeo3Wallet(w)) {
if ownerIDSrc.OwnerID().String() == owner.NewIDFromNeo3Wallet(w).String() {
return nil return nil
} }
@ -89,8 +88,7 @@ func (cp *Processor) checkKeyOwnershipWithToken(ownerIDSrc ownerIDSource, key *k
} }
// check owner // check owner
// TODO: need Equal method on owner.ID if !token.OwnerID().Equal(ownerIDSrc.OwnerID()) {
if token.OwnerID().String() != ownerIDSrc.OwnerID().String() {
return errors.New("owner differs with token owner") return errors.New("owner differs with token owner")
} }