From a9702e85baa45c92db44cde968f127067b58ab6e Mon Sep 17 00:00:00 2001 From: Warren He Date: Tue, 7 Jan 2020 14:01:41 -0800 Subject: [PATCH] go registry: update tests for per-runtime storage --- go/registry/tests/tester.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/go/registry/tests/tester.go b/go/registry/tests/tester.go index 96f76b2496f..8815200cad1 100644 --- a/go/registry/tests/tester.go +++ b/go/registry/tests/tester.go @@ -602,21 +602,18 @@ func (ent *TestEntity) NewTestNodes(nCompute int, nStorage int, runtimes []*node } nod.Entity = ent - var thisNodeRuntimes []*node.Runtime var role node.RolesMask if i < nCompute { role = node.RoleComputeWorker - thisNodeRuntimes = runtimes } else { role = node.RoleStorageWorker - thisNodeRuntimes = nil } nod.Node = &node.Node{ ID: nod.Signer.Public(), EntityID: ent.Entity.ID, Expiration: uint64(expiration), - Runtimes: thisNodeRuntimes, + Runtimes: runtimes, Roles: role, } addr := node.Address{ @@ -771,7 +768,7 @@ func (ent *TestEntity) NewTestNodes(nCompute int, nStorage int, runtimes []*node ID: nod.Signer.Public(), EntityID: ent.Entity.ID, Expiration: uint64(expiration), - Runtimes: thisNodeRuntimes, + Runtimes: runtimes, Roles: role, } addr = node.Address{ @@ -792,7 +789,7 @@ func (ent *TestEntity) NewTestNodes(nCompute int, nStorage int, runtimes []*node // Add invalid Re-Registration with changed Runtimes field. testRuntimeSigner := memorySigner.NewTestSigner("invalid-registration-runtime-seed") - newRuntimes := append([]*node.Runtime(nil), thisNodeRuntimes...) + newRuntimes := append([]*node.Runtime(nil), runtimes...) newRuntimes = append(newRuntimes, &node.Runtime{ID: publicKeyToNamespace(testRuntimeSigner.Public())}) newNode := &node.Node{ ID: nod.Signer.Public(),