[#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>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2021-05-28 15:46:41 +03:00 committed by Leonard Lyubich
parent 937171911a
commit 9359f28161
1 changed files with 2 additions and 4 deletions

View File

@ -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")
}