58
58
newNode2NodeID = ""
59
59
pausedNodeURI = ""
60
60
pausedNodeName = "node1"
61
- createdSubnetID = ""
62
- elasticAssetID = ""
63
61
newSubnetID = ""
64
62
customNodeConfigs = map [string ]string {
65
63
"node1" : `{"api-admin-enabled":true}` ,
@@ -73,36 +71,12 @@ var (
73
71
numNodes = uint32 (5 )
74
72
subnetParticipants = []string {"node1" , "node2" , "node3" }
75
73
newParticipantNode = "new_participant_node"
76
- delegateeNode = "permissionlessNode"
77
74
subnetParticipants2 = []string {"node1" , "node2" , newParticipantNode }
78
75
existingNodes = []string {"node1" , "node2" , "node3" , "node4" , "node5" }
79
76
disjointNewSubnetParticipants = [][]string {
80
77
{"n0" , "n1" , "n2" , "n3" , "n4" },
81
78
{"n5" , "n6" , "n7" , "n8" , "n9" },
82
79
}
83
- testElasticSubnetConfig = rpcpb.ElasticSubnetSpec {
84
- SubnetId : "" ,
85
- AssetName : "BLIZZARD" ,
86
- AssetSymbol : "BRRR" ,
87
- InitialSupply : 240000000 ,
88
- MaxSupply : 720000000 ,
89
- MinConsumptionRate : 100000 ,
90
- MaxConsumptionRate : 120000 ,
91
- MinValidatorStake : 2000 ,
92
- MaxValidatorStake : 3000000 ,
93
- MinStakeDuration : 14 * 24 ,
94
- MaxStakeDuration : 365 * 24 ,
95
- MinDelegationFee : 20000 ,
96
- MinDelegatorStake : 25 ,
97
- MaxValidatorWeightFactor : 5 ,
98
- UptimeRequirement : 0.8 * 1_000_000 ,
99
- }
100
-
101
- testValidatorConfig = rpcpb.PermissionlessStakerSpec {
102
- StakedTokenAmount : 2000 ,
103
- StartTime : time .Now ().Add (1 * time .Hour ).UTC ().Format (server .TimeParseLayout ),
104
- StakeDuration : 336 ,
105
- }
106
80
)
107
81
108
82
func init () {
@@ -927,107 +901,6 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
927
901
})
928
902
})
929
903
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
904
ginkgo .It ("snapshots + blockchain creation" , func () {
1032
905
var originalUris []string
1033
906
var originalSubnets []string
@@ -1037,15 +910,15 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
1037
910
originalUris , err = cli .URIs (ctx )
1038
911
cancel ()
1039
912
gomega .Ω (err ).Should (gomega .BeNil ())
1040
- gomega .Ω (len (originalUris )).Should (gomega .Equal (8 ))
913
+ gomega .Ω (len (originalUris )).Should (gomega .Equal (7 ))
1041
914
})
1042
915
ginkgo .By ("get original subnets" , func () {
1043
916
ctx , cancel := context .WithTimeout (context .Background (), 15 * time .Second )
1044
917
status , err := cli .Status (ctx )
1045
918
cancel ()
1046
919
gomega .Ω (err ).Should (gomega .BeNil ())
1047
920
numSubnets := len (status .ClusterInfo .Subnets )
1048
- gomega .Ω (numSubnets ).Should (gomega .Equal (5 ))
921
+ gomega .Ω (numSubnets ).Should (gomega .Equal (4 ))
1049
922
originalSubnets = maps .Keys (status .ClusterInfo .Subnets )
1050
923
})
1051
924
ginkgo .By ("check there are no snapshots" , func () {
0 commit comments