@@ -927,107 +927,6 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
927
927
})
928
928
})
929
929
930
- ginkgo .It ("transform subnet to elastic subnets" , func () {
931
- var elasticSubnetID string
932
- ginkgo .By ("add 1 subnet" , func () {
933
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
934
- resp , err := cli .CreateSubnets (ctx , []* rpcpb.SubnetSpec {{}})
935
- cancel ()
936
- gomega .Ω (err ).Should (gomega .BeNil ())
937
- gomega .Ω (len (resp .SubnetIds )).Should (gomega .Equal (1 ))
938
- gomega .Ω (len (resp .ClusterInfo .Subnets )).Should (gomega .Equal (5 ))
939
- createdSubnetID = resp .SubnetIds [0 ]
940
- })
941
- ginkgo .By ("check expected non elastic status" , func () {
942
- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
943
- status , err := cli .Status (ctx )
944
- cancel ()
945
- gomega .Ω (err ).Should (gomega .BeNil ())
946
- subnetInfo := status .ClusterInfo .Subnets [createdSubnetID ]
947
- gomega .Ω (subnetInfo .IsElastic ).Should (gomega .Equal (false ))
948
- gomega .Ω (subnetInfo .ElasticSubnetId ).Should (gomega .Equal (ids .Empty .String ()))
949
- })
950
- ginkgo .By ("transform 1 subnet to elastic subnet" , func () {
951
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
952
- defer cancel ()
953
- testElasticSubnetConfig .SubnetId = createdSubnetID
954
- response , err := cli .TransformElasticSubnets (ctx , []* rpcpb.ElasticSubnetSpec {& testElasticSubnetConfig })
955
- gomega .Ω (err ).Should (gomega .BeNil ())
956
- gomega .Ω (len (response .TxIds )).Should (gomega .Equal (1 ))
957
- gomega .Ω (len (response .AssetIds )).Should (gomega .Equal (1 ))
958
- elasticAssetID = response .AssetIds [0 ]
959
- })
960
- ginkgo .By ("check expected elastic status" , func () {
961
- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
962
- status , err := cli .Status (ctx )
963
- cancel ()
964
- gomega .Ω (err ).Should (gomega .BeNil ())
965
- subnetInfo := status .ClusterInfo .Subnets [createdSubnetID ]
966
- gomega .Ω (subnetInfo .IsElastic ).Should (gomega .Equal (true ))
967
- gomega .Ω (subnetInfo .ElasticSubnetId ).ShouldNot (gomega .Equal (ids .Empty .String ()))
968
- elasticSubnetID = subnetInfo .ElasticSubnetId
969
- })
970
- ginkgo .By ("transforming a subnet with same subnetID to elastic subnet will fail" , func () {
971
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
972
- defer cancel ()
973
- testElasticSubnetConfig .SubnetId = createdSubnetID
974
- _ , err := cli .TransformElasticSubnets (ctx , []* rpcpb.ElasticSubnetSpec {& testElasticSubnetConfig })
975
- gomega .Ω (err ).Should (gomega .HaveOccurred ())
976
- })
977
- ginkgo .By ("save snapshot with elastic info" , func () {
978
- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
979
- _ , err := cli .SaveSnapshot (ctx , "elastic_snapshot" , false )
980
- cancel ()
981
- gomega .Ω (err ).Should (gomega .BeNil ())
982
- })
983
- ginkgo .By ("load snapshot with elastic info" , func () {
984
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
985
- _ , err := cli .LoadSnapshot (ctx , "elastic_snapshot" , false )
986
- cancel ()
987
- gomega .Ω (err ).Should (gomega .BeNil ())
988
- })
989
- ginkgo .By ("check expected elastic status" , func () {
990
- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
991
- status , err := cli .Status (ctx )
992
- cancel ()
993
- gomega .Ω (err ).Should (gomega .BeNil ())
994
- subnetInfo := status .ClusterInfo .Subnets [createdSubnetID ]
995
- gomega .Ω (subnetInfo .IsElastic ).Should (gomega .Equal (true ))
996
- gomega .Ω (subnetInfo .ElasticSubnetId ).Should (gomega .Equal (elasticSubnetID ))
997
- })
998
- ginkgo .By ("remove snapshot with elastic info" , func () {
999
- ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
1000
- _ , err := cli .RemoveSnapshot (ctx , "elastic_snapshot" )
1001
- cancel ()
1002
- gomega .Ω (err ).Should (gomega .BeNil ())
1003
- })
1004
- })
1005
-
1006
- ginkgo .It ("add permissionless validator to elastic subnets" , func () {
1007
- ginkgo .By ("adding a permissionless validator to elastic subnet" , func () {
1008
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
1009
- defer cancel ()
1010
- testValidatorConfig .SubnetId = createdSubnetID
1011
- testValidatorConfig .AssetId = elasticAssetID
1012
- testValidatorConfig .NodeName = delegateeNode
1013
- _ , err := cli .AddPermissionlessValidator (ctx , []* rpcpb.PermissionlessStakerSpec {& testValidatorConfig })
1014
- gomega .Ω (err ).Should (gomega .BeNil ())
1015
- })
1016
- })
1017
-
1018
- ginkgo .It ("add permissionless delegator to elastic subnets" , func () {
1019
- ginkgo .By ("adding a permissionless delegator to permissionless validator" , func () {
1020
- ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Minute )
1021
- defer cancel ()
1022
- testValidatorConfig .SubnetId = createdSubnetID
1023
- testValidatorConfig .AssetId = elasticAssetID
1024
- testValidatorConfig .NodeName = delegateeNode
1025
- testValidatorConfig .StakedTokenAmount = 35
1026
- _ , err := cli .AddPermissionlessDelegator (ctx , []* rpcpb.PermissionlessStakerSpec {& testValidatorConfig })
1027
- gomega .Ω (err ).Should (gomega .BeNil ())
1028
- })
1029
- })
1030
-
1031
930
ginkgo .It ("snapshots + blockchain creation" , func () {
1032
931
var originalUris []string
1033
932
var originalSubnets []string
@@ -1037,15 +936,15 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
1037
936
originalUris , err = cli .URIs (ctx )
1038
937
cancel ()
1039
938
gomega .Ω (err ).Should (gomega .BeNil ())
1040
- gomega .Ω (len (originalUris )).Should (gomega .Equal (8 ))
939
+ gomega .Ω (len (originalUris )).Should (gomega .Equal (7 ))
1041
940
})
1042
941
ginkgo .By ("get original subnets" , func () {
1043
942
ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
1044
943
status , err := cli .Status (ctx )
1045
944
cancel ()
1046
945
gomega .Ω (err ).Should (gomega .BeNil ())
1047
946
numSubnets := len (status .ClusterInfo .Subnets )
1048
- gomega .Ω (numSubnets ).Should (gomega .Equal (5 ))
947
+ gomega .Ω (numSubnets ).Should (gomega .Equal (4 ))
1049
948
originalSubnets = maps .Keys (status .ClusterInfo .Subnets )
1050
949
})
1051
950
ginkgo .By ("check there are no snapshots" , func () {
0 commit comments