[#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 8 additions and 8 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

BIN
go.sum

Binary file not shown.

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()
}, },
} }