[#174] Update to neofs-api-go v1.20.0

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-17 11:51:49 +03:00 committed by Alex Vanin
parent 58fcb35fb0
commit 1caf15463e
4 changed files with 10 additions and 10 deletions

2
go.mod
View file

@ -14,7 +14,7 @@ require (
github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2
github.com/multiformats/go-multihash v0.0.13 // indirect github.com/multiformats/go-multihash v0.0.13 // indirect
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b
github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201116094437-fe336fd5ba28 github.com/nspcc-dev/neofs-api-go v1.20.0
github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/nspcc-dev/neofs-crypto v0.3.0
github.com/nspcc-dev/tzhash v1.4.0 github.com/nspcc-dev/tzhash v1.4.0
github.com/panjf2000/ants/v2 v2.3.0 github.com/panjf2000/ants/v2 v2.3.0

4
go.sum
View file

@ -276,8 +276,8 @@ github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:
github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc=
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b h1:gk5bZgpWOehaDVKI5vBDkcjXTpRkKqcvIb1h/vHnBH4= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b h1:gk5bZgpWOehaDVKI5vBDkcjXTpRkKqcvIb1h/vHnBH4=
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b/go.mod h1:9s7LNp2lMgf0caH2t0sam4+WT2SIauXozwP0AdBqnEo= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b/go.mod h1:9s7LNp2lMgf0caH2t0sam4+WT2SIauXozwP0AdBqnEo=
github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201116094437-fe336fd5ba28 h1:FPS4eJx50eFnyfhiHCVmaOdv3q60duAuUZMVosILXX4= github.com/nspcc-dev/neofs-api-go v1.20.0 h1:su+2Q3KxqHGAfuHBbSOOuJdbQpbvDFcenv6LXjZz2Ik=
github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201116094437-fe336fd5ba28/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= github.com/nspcc-dev/neofs-api-go v1.20.0/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8=
github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA=
github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM= github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM=

View file

@ -23,8 +23,8 @@ func CheckFormat(c *container.Container) error {
return errors.Wrap(err, "incorrect version") return errors.Wrap(err, "incorrect version")
} }
if len(c.OwnerID().ToV2().GetValue()) != owner.NEO3WalletSize { if ln := len(c.OwnerID().ToV2().GetValue()); ln != owner.NEO3WalletSize {
return errors.Wrap(owner.ErrBadID, "incorrect owner identifier") return errors.Errorf("incorrect owner identifier: expected length %d != %d", owner.NEO3WalletSize, ln)
} }
if _, err := uuid.FromBytes(c.Nonce()); err != nil { if _, err := uuid.FromBytes(c.Nonce()); err != nil {

View file

@ -107,7 +107,7 @@ func tableAction(unit *ValidationUnit, table *eacl.Table) eacl.Action {
// - positive value if no matching header is found for at least one filter; // - positive value if no matching header is found for at least one filter;
// - zero if at least one suitable header is found for all filters; // - zero if at least one suitable header is found for all filters;
// - negative value if the headers of at least one filter cannot be obtained. // - negative value if the headers of at least one filter cannot be obtained.
func matchFilters(hdrSrc TypedHeaderSource, filters []eacl.Filter) int { func matchFilters(hdrSrc TypedHeaderSource, filters []*eacl.Filter) int {
matched := 0 matched := 0
for _, filter := range filters { for _, filter := range filters {
@ -151,7 +151,7 @@ func matchFilters(hdrSrc TypedHeaderSource, filters []eacl.Filter) int {
// returns true if one of ExtendedACLTarget has // returns true if one of ExtendedACLTarget has
// suitable target OR suitable public key. // suitable target OR suitable public key.
func targetMatches(unit *ValidationUnit, record eacl.Record) bool { func targetMatches(unit *ValidationUnit, record *eacl.Record) bool {
for _, target := range record.Targets() { for _, target := range record.Targets() {
// check public key match // check public key match
for _, key := range target.Keys() { for _, key := range target.Keys() {
@ -170,12 +170,12 @@ func targetMatches(unit *ValidationUnit, record eacl.Record) bool {
} }
// Maps match type to corresponding function. // Maps match type to corresponding function.
var mMatchFns = map[eacl.Match]func(Header, eacl.Filter) bool{ var mMatchFns = map[eacl.Match]func(Header, *eacl.Filter) bool{
eacl.MatchStringEqual: func(header Header, filter eacl.Filter) bool { eacl.MatchStringEqual: func(header Header, filter *eacl.Filter) bool {
return header.Value() == filter.Value() return header.Value() == filter.Value()
}, },
eacl.MatchStringNotEqual: func(header Header, filter eacl.Filter) bool { eacl.MatchStringNotEqual: func(header Header, filter *eacl.Filter) bool {
return header.Value() != filter.Value() return header.Value() != filter.Value()
}, },
} }