From d78edb66db4f9b186248feabafe5890fd8250363 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 10 Dec 2021 14:17:23 +0300 Subject: [PATCH] [#199] test: Use `storage.RemovePrefix` flag Signed-off-by: Pavel Karpy --- subnet/subnet_contract.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subnet/subnet_contract.go b/subnet/subnet_contract.go index 2743c17..3e7ce6d 100644 --- a/subnet/subnet_contract.go +++ b/subnet/subnet_contract.go @@ -578,12 +578,10 @@ func calledByOwnerOrAdmin(ctx storage.Context, owner []byte, adminPrefix []byte) return true } - prefixLen := len(adminPrefix) - - iter := storage.Find(ctx, adminPrefix, storage.KeysOnly) + iter := storage.Find(ctx, adminPrefix, storage.KeysOnly|storage.RemovePrefix) for iterator.Next(iter) { key := iterator.Value(iter).([]byte) - if runtime.CheckWitness(key[prefixLen:]) { + if runtime.CheckWitness(key) { return true } }