@@ -28,7 +28,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
28
28
uint64 (defaultValidateStartTime .Unix ()),
29
29
uint64 (defaultValidateEndTime .Unix ()),
30
30
defaultKey .PublicKey ().Address (),
31
- testSubnet1 .ID ,
31
+ testSubnet1 .id ,
32
32
testNetworkID ,
33
33
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
34
34
defaultKey ,
@@ -48,7 +48,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
48
48
uint64 (defaultValidateStartTime .Unix ()),
49
49
uint64 (defaultValidateEndTime .Unix ()),
50
50
defaultKey .PublicKey ().Address (),
51
- testSubnet1 .ID ,
51
+ testSubnet1 .id ,
52
52
testNetworkID + 1 ,
53
53
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
54
54
defaultKey ,
@@ -67,7 +67,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
67
67
uint64 (defaultValidateStartTime .Unix ()),
68
68
uint64 (defaultValidateEndTime .Unix ()),
69
69
defaultKey .PublicKey ().Address (),
70
- testSubnet1 .ID ,
70
+ testSubnet1 .id ,
71
71
testNetworkID ,
72
72
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
73
73
defaultKey ,
@@ -87,7 +87,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
87
87
uint64 (defaultValidateStartTime .Unix ()),
88
88
uint64 (defaultValidateEndTime .Unix ()),
89
89
defaultKey .PublicKey ().Address (),
90
- testSubnet1 .ID ,
90
+ testSubnet1 .id ,
91
91
testNetworkID ,
92
92
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
93
93
defaultKey ,
@@ -107,7 +107,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
107
107
uint64 (defaultValidateStartTime .Unix ()),
108
108
uint64 (defaultValidateEndTime .Unix ()),
109
109
defaultKey .PublicKey ().Address (),
110
- testSubnet1 .ID ,
110
+ testSubnet1 .id ,
111
111
testNetworkID ,
112
112
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
113
113
defaultKey ,
@@ -126,7 +126,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
126
126
uint64 (defaultValidateStartTime .Unix ()),
127
127
uint64 (defaultValidateEndTime .Unix ())- 1 ,
128
128
defaultKey .PublicKey ().Address (),
129
- testSubnet1 .ID ,
129
+ testSubnet1 .id ,
130
130
testNetworkID ,
131
131
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
132
132
defaultKey ,
@@ -147,7 +147,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
147
147
uint64 (defaultValidateStartTime .Unix ()),
148
148
uint64 (defaultValidateStartTime .Add (MinimumStakingDuration ).Unix ())- 1 ,
149
149
defaultKey .PublicKey ().Address (),
150
- testSubnet1 .ID ,
150
+ testSubnet1 .id ,
151
151
testNetworkID ,
152
152
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
153
153
defaultKey ,
@@ -167,7 +167,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
167
167
uint64 (defaultValidateStartTime .Unix ()),
168
168
uint64 (defaultValidateStartTime .Add (MaximumStakingDuration ).Unix ())+ 1 ,
169
169
defaultKey .PublicKey ().Address (),
170
- testSubnet1 .ID ,
170
+ testSubnet1 .id ,
171
171
testNetworkID ,
172
172
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
173
173
defaultKey ,
@@ -187,7 +187,7 @@ func TestAddNonDefaultSubnetValidatorTxSyntacticVerify(t *testing.T) {
187
187
uint64 (defaultValidateStartTime .Unix ()),
188
188
uint64 (defaultValidateEndTime .Unix ()),
189
189
defaultKey .PublicKey ().Address (),
190
- testSubnet1 .ID ,
190
+ testSubnet1 .id ,
191
191
testNetworkID ,
192
192
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
193
193
defaultKey ,
@@ -212,7 +212,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
212
212
uint64 (defaultValidateStartTime .Unix ()),
213
213
uint64 (defaultValidateEndTime .Unix ())+ 1 ,
214
214
defaultKey .PublicKey ().Address (),
215
- testSubnet1 .ID ,
215
+ testSubnet1 .id ,
216
216
testNetworkID ,
217
217
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
218
218
defaultKey ,
@@ -235,7 +235,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
235
235
uint64 (defaultValidateStartTime .Unix ()),
236
236
uint64 (defaultValidateEndTime .Unix ()),
237
237
defaultKey .PublicKey ().Address (),
238
- testSubnet1 .ID ,
238
+ testSubnet1 .id ,
239
239
testNetworkID ,
240
240
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
241
241
defaultKey ,
@@ -245,15 +245,15 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
245
245
}
246
246
_ , _ , _ , _ , err = tx .SemanticVerify (vm .DB )
247
247
if err != nil {
248
- t .Log (testSubnet1 .ID )
248
+ t .Log (testSubnet1 .id )
249
249
subnets , err := vm .getSubnets (vm .DB )
250
250
if err != nil {
251
251
t .Fatal (err )
252
252
}
253
253
if len (subnets ) == 0 {
254
254
t .Fatal ("no subnets found" )
255
255
}
256
- t .Logf ("subnets[0].ID: %v" , subnets [0 ].ID )
256
+ t .Logf ("subnets[0].ID: %v" , subnets [0 ].id )
257
257
t .Fatal (err )
258
258
}
259
259
@@ -290,7 +290,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
290
290
uint64 (DSStartTime .Unix ()), // start validating non-default subnet before default subnet
291
291
uint64 (DSEndTime .Unix ()),
292
292
pendingDSValidatorID ,
293
- testSubnet1 .ID ,
293
+ testSubnet1 .id ,
294
294
testNetworkID ,
295
295
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
296
296
defaultKey ,
@@ -324,7 +324,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
324
324
uint64 (DSStartTime .Unix ())- 1 , // start validating non-default subnet before default subnet
325
325
uint64 (DSEndTime .Unix ()),
326
326
pendingDSValidatorID ,
327
- testSubnet1 .ID ,
327
+ testSubnet1 .id ,
328
328
testNetworkID ,
329
329
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
330
330
defaultKey ,
@@ -346,7 +346,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
346
346
uint64 (DSStartTime .Unix ()),
347
347
uint64 (DSEndTime .Unix ())+ 1 , // stop validating non-default subnet after stopping validating default subnet
348
348
pendingDSValidatorID ,
349
- testSubnet1 .ID ,
349
+ testSubnet1 .id ,
350
350
testNetworkID ,
351
351
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
352
352
defaultKey ,
@@ -368,7 +368,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
368
368
uint64 (DSStartTime .Unix ()), // same start time as for default subnet
369
369
uint64 (DSEndTime .Unix ()), // same end time as for default subnet
370
370
pendingDSValidatorID ,
371
- testSubnet1 .ID ,
371
+ testSubnet1 .id ,
372
372
testNetworkID ,
373
373
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
374
374
defaultKey ,
@@ -389,12 +389,12 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
389
389
}
390
390
391
391
tx , err = vm .newAddNonDefaultSubnetValidatorTx (
392
- defaultNonce + 1 , // nonce
393
- defaultWeight , // weight
394
- uint64 (newTimestamp .Unix ()), // start time
392
+ defaultNonce + 1 , // nonce
393
+ defaultWeight , // weight
394
+ uint64 (newTimestamp .Unix ()), // start time
395
395
uint64 (newTimestamp .Add (MinimumStakingDuration ).Unix ()), // end time
396
396
defaultKey .PublicKey ().Address (), // node ID
397
- testSubnet1 .ID , // subnet ID
397
+ testSubnet1 .id , // subnet ID
398
398
testNetworkID , // network ID
399
399
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
400
400
defaultKey , // tx fee payer
@@ -429,7 +429,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
429
429
uint64 (defaultValidateStartTime .Unix ()), // start time
430
430
uint64 (defaultValidateEndTime .Unix ()), // end time
431
431
defaultKey .PublicKey ().Address (), // node ID
432
- testSubnet1 .ID , // subnet ID
432
+ testSubnet1 .id , // subnet ID
433
433
testNetworkID , // network ID
434
434
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
435
435
newAcctKey .(* crypto.PrivateKeySECP256K1R ), // tx fee payer
@@ -451,7 +451,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
451
451
uint64 (defaultValidateStartTime .Unix ()), // start time
452
452
uint64 (defaultValidateEndTime .Unix ()), // end time
453
453
defaultKey .PublicKey ().Address (), // node ID
454
- testSubnet1 .ID , // subnet ID
454
+ testSubnet1 .id , // subnet ID
455
455
testNetworkID , // network ID
456
456
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
457
457
defaultKey , // tx fee payer
@@ -465,7 +465,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
465
465
SortByStartTime : false ,
466
466
Txs : []TimedTx {tx },
467
467
},
468
- testSubnet1 .ID ,
468
+ testSubnet1 .id ,
469
469
)
470
470
// Node with ID nodeIDKey.PublicKey().Address() now validating subnet with ID testSubnet1.ID
471
471
@@ -475,7 +475,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
475
475
uint64 (defaultValidateStartTime .Unix ()), // start time
476
476
uint64 (defaultValidateEndTime .Unix ()), // end time
477
477
defaultKey .PublicKey ().Address (), // node ID
478
- testSubnet1 .ID , // subnet ID
478
+ testSubnet1 .id , // subnet ID
479
479
testNetworkID , // network ID
480
480
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
481
481
defaultKey , // tx fee payer
@@ -494,17 +494,17 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
494
494
& EventHeap {
495
495
SortByStartTime : false ,
496
496
},
497
- testSubnet1 .ID ,
497
+ testSubnet1 .id ,
498
498
)
499
499
500
500
// Case 9: Too many signatures
501
501
tx , err = vm .newAddNonDefaultSubnetValidatorTx (
502
- defaultNonce + 1 , // nonce
503
- defaultWeight , // weight
504
- uint64 (defaultGenesisTime .Unix ()), // start time
502
+ defaultNonce + 1 , // nonce
503
+ defaultWeight , // weight
504
+ uint64 (defaultGenesisTime .Unix ()), // start time
505
505
uint64 (defaultGenesisTime .Add (MinimumStakingDuration ).Unix ())+ 1 , // end time
506
506
keys [0 ].PublicKey ().Address (), // node ID
507
- testSubnet1 .ID , // subnet ID
507
+ testSubnet1 .id , // subnet ID
508
508
testNetworkID , // network ID
509
509
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ], testSubnet1ControlKeys [2 ]},
510
510
defaultKey , // tx fee payer
@@ -520,12 +520,12 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
520
520
521
521
// Case 10: Too few signatures
522
522
tx , err = vm .newAddNonDefaultSubnetValidatorTx (
523
- defaultNonce + 1 , // nonce
524
- defaultWeight , // weight
525
- uint64 (defaultGenesisTime .Unix ()), // start time
523
+ defaultNonce + 1 , // nonce
524
+ defaultWeight , // weight
525
+ uint64 (defaultGenesisTime .Unix ()), // start time
526
526
uint64 (defaultGenesisTime .Add (MinimumStakingDuration ).Unix ()), // end time
527
527
keys [0 ].PublicKey ().Address (), // node ID
528
- testSubnet1 .ID , // subnet ID
528
+ testSubnet1 .id , // subnet ID
529
529
testNetworkID , // network ID
530
530
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [2 ]},
531
531
defaultKey , // tx fee payer
@@ -541,12 +541,12 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
541
541
542
542
// Case 10: Control Signature from invalid key
543
543
tx , err = vm .newAddNonDefaultSubnetValidatorTx (
544
- defaultNonce + 1 , // nonce
545
- defaultWeight , // weight
546
- uint64 (defaultGenesisTime .Unix ()), // start time
544
+ defaultNonce + 1 , // nonce
545
+ defaultWeight , // weight
546
+ uint64 (defaultGenesisTime .Unix ()), // start time
547
547
uint64 (defaultGenesisTime .Add (MinimumStakingDuration ).Unix ()), // end time
548
548
keys [0 ].PublicKey ().Address (), // node ID
549
- testSubnet1 .ID , // subnet ID
549
+ testSubnet1 .id , // subnet ID
550
550
testNetworkID , // network ID
551
551
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], keys [3 ]},
552
552
defaultKey , // tx fee payer
@@ -563,12 +563,12 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
563
563
// Case 11: Proposed validator in pending validator set for subnet
564
564
// First, add validator to pending validator set of subnet
565
565
tx , err = vm .newAddNonDefaultSubnetValidatorTx (
566
- defaultNonce + 1 , // nonce
567
- defaultWeight , // weight
568
- uint64 (defaultGenesisTime .Unix ())+ 1 , // start time
566
+ defaultNonce + 1 , // nonce
567
+ defaultWeight , // weight
568
+ uint64 (defaultGenesisTime .Unix ())+ 1 , // start time
569
569
uint64 (defaultGenesisTime .Add (MinimumStakingDuration ).Unix ())+ 1 , // end time
570
570
defaultKey .PublicKey ().Address (), // node ID
571
- testSubnet1 .ID , // subnet ID
571
+ testSubnet1 .id , // subnet ID
572
572
testNetworkID , // network ID
573
573
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
574
574
defaultKey , // tx fee payer
@@ -582,7 +582,7 @@ func TestAddNonDefaultSubnetValidatorTxSemanticVerify(t *testing.T) {
582
582
SortByStartTime : true ,
583
583
Txs : []TimedTx {tx },
584
584
},
585
- testSubnet1 .ID ,
585
+ testSubnet1 .id ,
586
586
)
587
587
// Node with ID nodeIDKey.PublicKey().Address() now pending validator for subnet with ID testSubnet1.ID
588
588
@@ -604,7 +604,7 @@ func TestAddNonDefaultSubnetValidatorMarshal(t *testing.T) {
604
604
uint64 (defaultValidateStartTime .Unix ()),
605
605
uint64 (defaultValidateEndTime .Unix ()),
606
606
defaultKey .PublicKey ().Address (),
607
- testSubnet1 .ID ,
607
+ testSubnet1 .id ,
608
608
testNetworkID ,
609
609
[]* crypto.PrivateKeySECP256K1R {testSubnet1ControlKeys [0 ], testSubnet1ControlKeys [1 ]},
610
610
defaultKey ,
0 commit comments