7
7
"path"
8
8
"path/filepath"
9
9
"testing"
10
-
11
- "github.com/cosmos/cosmos-sdk/x/slashing"
10
+ "time"
12
11
13
12
"github.com/tendermint/tendermint/crypto/ed25519"
14
13
@@ -27,7 +26,7 @@ import (
27
26
28
27
func TestGaiaCLIMinimumFees (t * testing.T ) {
29
28
t .Parallel ()
30
- f := initializeFixtures (t )
29
+ f := InitFixtures (t )
31
30
32
31
// start gaiad server with minimum fees
33
32
fees := fmt .Sprintf ("--minimum_fees=%s,%s" , sdk .NewInt64Coin (feeDenom , 2 ), sdk .NewInt64Coin (denom , 2 ))
@@ -70,7 +69,7 @@ func TestGaiaCLIMinimumFees(t *testing.T) {
70
69
71
70
func TestGaiaCLIFeesDeduction (t * testing.T ) {
72
71
t .Parallel ()
73
- f := initializeFixtures (t )
72
+ f := InitFixtures (t )
74
73
75
74
// start gaiad server with minimum fees
76
75
proc := f .GDStart (fmt .Sprintf ("--minimum_fees=%s" , sdk .NewInt64Coin (fooDenom , 1 )))
@@ -120,7 +119,7 @@ func TestGaiaCLIFeesDeduction(t *testing.T) {
120
119
121
120
func TestGaiaCLISend (t * testing.T ) {
122
121
t .Parallel ()
123
- f := initializeFixtures (t )
122
+ f := InitFixtures (t )
124
123
125
124
// start gaiad server
126
125
proc := f .GDStart ()
@@ -176,7 +175,7 @@ func TestGaiaCLISend(t *testing.T) {
176
175
177
176
func TestGaiaCLIGasAuto (t * testing.T ) {
178
177
t .Parallel ()
179
- f := initializeFixtures (t )
178
+ f := InitFixtures (t )
180
179
181
180
// start gaiad server
182
181
proc := f .GDStart ()
@@ -236,7 +235,7 @@ func TestGaiaCLIGasAuto(t *testing.T) {
236
235
237
236
func TestGaiaCLICreateValidator (t * testing.T ) {
238
237
t .Parallel ()
239
- f := initializeFixtures (t )
238
+ f := InitFixtures (t )
240
239
241
240
// start gaiad server
242
241
proc := f .GDStart ()
@@ -319,7 +318,7 @@ func TestGaiaCLICreateValidator(t *testing.T) {
319
318
320
319
func TestGaiaCLISubmitProposal (t * testing.T ) {
321
320
t .Parallel ()
322
- f := initializeFixtures (t )
321
+ f := InitFixtures (t )
323
322
324
323
// start gaiad server
325
324
proc := f .GDStart ()
@@ -460,7 +459,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
460
459
461
460
func TestGaiaCLIValidateSignatures (t * testing.T ) {
462
461
t .Parallel ()
463
- f := initializeFixtures (t )
462
+ f := InitFixtures (t )
464
463
465
464
// start gaiad server
466
465
proc := f .GDStart ()
@@ -510,7 +509,7 @@ func TestGaiaCLIValidateSignatures(t *testing.T) {
510
509
511
510
func TestGaiaCLISendGenerateSignAndBroadcast (t * testing.T ) {
512
511
t .Parallel ()
513
- f := initializeFixtures (t )
512
+ f := InitFixtures (t )
514
513
515
514
// start gaiad server
516
515
proc := f .GDStart ()
@@ -601,7 +600,7 @@ func TestGaiaCLISendGenerateSignAndBroadcast(t *testing.T) {
601
600
602
601
func TestGaiaCLIConfig (t * testing.T ) {
603
602
t .Parallel ()
604
- f := initializeFixtures (t )
603
+ f := InitFixtures (t )
605
604
node := fmt .Sprintf ("%s:%s" , f .RPCAddr , f .Port )
606
605
607
606
// Set available configuration options
@@ -620,7 +619,8 @@ trace = false
620
619
trust-node = true
621
620
` , f .ChainID , node )
622
621
require .Equal (t , expectedConfig , string (config ))
623
- cleanupDirs (f .GDHome , f .GCLIHome )
622
+
623
+ f .Cleanup ()
624
624
}
625
625
626
626
func TestGaiadCollectGentxs (t * testing.T ) {
@@ -659,32 +659,16 @@ func TestGaiadCollectGentxs(t *testing.T) {
659
659
f .Cleanup (gentxDir )
660
660
}
661
661
662
- // ---------------------------------------------------------------------------
663
- // Slashing
664
-
665
662
func TestSlashingGetParams (t * testing.T ) {
666
663
t .Parallel ()
667
- cdc := app .MakeCodec ()
668
- f := initializeFixtures (t )
669
- flags := fmt .Sprintf ("--home=%s --node=%v --chain-id=%v" , f .GCLIHome , f .RPCAddr , f .ChainID )
664
+ f := InitFixtures (t )
670
665
671
666
// start gaiad server
672
- proc := tests .GoExecuteTWithStdout (
673
- t ,
674
- fmt .Sprintf (
675
- "gaiad start --home=%s --rpc.laddr=%v --p2p.laddr=%v" ,
676
- f .GDHome , f .RPCAddr , f .P2PAddr ,
677
- ),
678
- )
679
-
667
+ proc := f .GDStart ()
680
668
defer proc .Stop (false )
681
- tests .WaitForTMStart (f .Port )
682
- tests .WaitForNextNBlocksTM (1 , f .Port )
683
669
684
- res , errStr := tests .ExecuteT (t , fmt .Sprintf ("gaiacli query slashing params %s" , flags ), "" )
685
- require .Empty (t , errStr )
686
-
687
- var params slashing.Params
688
- err := cdc .UnmarshalJSON ([]byte (res ), & params )
689
- require .NoError (t , err )
670
+ params := f .QuerySlashingParams ()
671
+ require .Equal (t , time .Duration (120000000000 ), params .MaxEvidenceAge )
672
+ require .Equal (t , int64 (100 ), params .SignedBlocksWindow )
673
+ require .Equal (t , sdk .NewDecWithPrec (5 , 1 ), params .MinSignedPerWindow )
690
674
}
0 commit comments