policy: Fix IteratorChainsByPrefix
#84
2 changed files with 4 additions and 1 deletions
|
@ -115,7 +115,7 @@ func mapToNumeric(ctx storage.Context, kind Kind, name []byte) (mapped int, mapp
|
|||
mKey := mapKey(kind, name)
|
||||
numericID := storage.Get(ctx, mKey)
|
||||
if numericID == nil {
|
||||
return
|
||||
return 0, false
|
||||
}
|
||||
mapped = numericID.(int)
|
||||
mappingExists = true
|
||||
|
|
|
@ -32,6 +32,9 @@ func newPolicyInvoker(t *testing.T) *neotest.ContractInvoker {
|
|||
func TestPolicy(t *testing.T) {
|
||||
e := newPolicyInvoker(t)
|
||||
|
||||
checkChainsIteratorByPrefix(t, e, policy.Namespace, "mynamespace", "ingress", [][]byte{})
|
||||
checkChainsIteratorByPrefix(t, e, policy.Container, "cnr1", "ingress", [][]byte{})
|
||||
|
||||
// Policies are opaque to the contract and are just raw bytes to store.
|
||||
p1 := []byte("chain1")
|
||||
p2 := []byte("chain2")
|
||||
|
|
Loading…
Reference in a new issue