Skip to content

Commit

Permalink
go registry: update tests for per-runtime storage
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Jan 7, 2020
1 parent bbfdc1c commit e50b619
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions go/registry/tests/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand All @@ -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(),
Expand Down

0 comments on commit e50b619

Please sign in to comment.