Skip to content

Commit

Permalink
refactor(cluster): field name for grouped vNodes is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
yahortsaryk committed Aug 15, 2023
1 parent 2dc24e5 commit 925cbba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions contract/pkg/bucket/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ type NodeVNodesInfo struct {
}

type ClusterStatus struct {
ClusterId ClusterId
Cluster Cluster
VNodes []NodeVNodesInfo
ClusterId ClusterId
Cluster Cluster
NodesVNodes []NodeVNodesInfo
}

type NewCluster struct {
Expand Down
12 changes: 6 additions & 6 deletions contract/pkg/bucket/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func TestBucketWriteAccess(t *testing.T) {

func TestClusterStatus_ReplicationFactor(t *testing.T) {
type fields struct {
ClusterId ClusterId
Cluster Cluster
VNodes []NodeVNodesInfo
ClusterId ClusterId
Cluster Cluster
NodesVNodes []NodeVNodesInfo
}
tests := []struct {
name string
Expand Down Expand Up @@ -72,9 +72,9 @@ func TestClusterStatus_ReplicationFactor(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &ClusterStatus{
ClusterId: tt.fields.ClusterId,
Cluster: tt.fields.Cluster,
VNodes: tt.fields.VNodes,
ClusterId: tt.fields.ClusterId,
Cluster: tt.fields.Cluster,
NodesVNodes: tt.fields.NodesVNodes,
}
assert.Equalf(t, tt.want, c.ReplicationFactor(), "ReplicationFactor()")
})
Expand Down
10 changes: 4 additions & 6 deletions contract/pkg/mock/ddc_bucket_contract_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ type (
}

Cluster struct {
Id uint32
VNodes []NodeVNodes
Nodes []string
Params string
Id uint32
NodesVNodes []NodeVNodes
Params string
}

NodeVNodes struct {
Expand Down Expand Up @@ -120,13 +119,12 @@ func (d *ddcBucketContractMock) ClusterGet(clusterId uint32) (*bucket.ClusterSta
Cluster: bucket.Cluster{
ManagerId: types.AccountID{},
Params: cluster.Params,
NodesKeys: cluster.Nodes,
ResourcePerVNode: 32,
ResourceUsed: 0,
Revenues: types.NewU128(*big.NewInt(1)),
TotalRent: types.NewU128(*big.NewInt(1)),
},
VNodes: mapNodesVNodes(cluster.VNodes),
NodesVNodes: mapNodesVNodes(cluster.NodesVNodes),
}, nil
}
}
Expand Down

0 comments on commit 925cbba

Please sign in to comment.