[#570] *: Use new Equal method of owner.ID type

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-31 13:30:59 +03:00 committed by Leonard Lyubich
parent 49a42b1d3e
commit 70a7354e9d
4 changed files with 7 additions and 12 deletions

View file

@ -1,7 +1,6 @@
package acl
import (
"bytes"
"context"
"crypto/ecdsa"
"errors"
@ -765,11 +764,7 @@ func isOwnerFromKey(id *owner.ID, key *ecdsa.PublicKey) bool {
return false
}
// here we compare `owner.ID -> wallet` with `wallet <- publicKey`
// consider making equal method on owner.ID structure
// we can compare .String() version of owners but don't think it is good idea
// binary comparison is better but MarshalBinary is more expensive
return bytes.Equal(id.ToV2().GetValue(), wallet.Bytes())
return id.Equal(owner.NewIDFromNeo3Wallet(wallet))
}
// originalBearerToken goes down to original request meta header and fetches