This commit is contained in:
sukantoraymond
2023-05-25 18:44:58 -04:00
parent eae7654b0c
commit ddd10d757d
2 changed files with 14 additions and 8 deletions
+3 -6
View File
@@ -607,10 +607,7 @@ func (s *server) RemoveSubnetValidator(
validatorSpecList := []network.RemoveSubnetValidatorSpec{}
for _, spec := range req.GetValidatorSpec() {
validatorSpec, err := getRemoveSubnetValidatorSpec(spec)
if err != nil {
return nil, err
}
validatorSpec := getRemoveSubnetValidatorSpec(spec)
validatorSpecList = append(validatorSpecList, validatorSpec)
}
@@ -1422,12 +1419,12 @@ func getPermissionlessValidatorSpec(
func getRemoveSubnetValidatorSpec(
spec *rpcpb.RemoveSubnetValidatorSpec,
) (network.RemoveSubnetValidatorSpec, error) {
) network.RemoveSubnetValidatorSpec {
validatorSpec := network.RemoveSubnetValidatorSpec{
SubnetID: &spec.SubnetId,
NodeNames: spec.GetNodeNames(),
}
return validatorSpec, nil
return validatorSpec
}
func getNetworkBlockchainSpec(
+11 -2
View File
@@ -946,6 +946,15 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
ginkgo.It("transform subnet to elastic subnets", func() {
var createdSubnetID string
ginkgo.By("add 1 subnet", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
resp, err := cli.CreateSubnets(ctx, []*rpcpb.SubnetSpec{{Participants: subnetParticipants}})
cancel()
gomega.Ω(err).Should(gomega.BeNil())
gomega.Ω(len(resp.SubnetIds)).Should(gomega.Equal(1))
gomega.Ω(len(resp.ClusterInfo.Subnets)).Should(gomega.Equal(6))
createdSubnetID = resp.SubnetIds[0]
})
ginkgo.By("transform 1 subnet to elastic subnet", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
@@ -972,7 +981,7 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
cancel()
gomega.Ω(err).Should(gomega.BeNil())
gomega.Ω(len(resp.SubnetIds)).Should(gomega.Equal(1))
gomega.Ω(len(resp.ClusterInfo.Subnets)).Should(gomega.Equal(6))
gomega.Ω(len(resp.ClusterInfo.Subnets)).Should(gomega.Equal(7))
createdSubnetID = resp.SubnetIds[0]
})
ginkgo.By("transform 1 subnet to elastic subnet", func() {
@@ -1005,7 +1014,7 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
originalUris, err = cli.URIs(ctx)
cancel()
gomega.Ω(err).Should(gomega.BeNil())
gomega.Ω(len(originalUris)).Should(gomega.Equal(7))
gomega.Ω(len(originalUris)).Should(gomega.Equal(8))
})
ginkgo.By("get original subnets", func() {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)