@@ -37,6 +37,11 @@ const (
37
37
V300 = "v3.0.0"
38
38
)
39
39
40
+ // type aliases
41
+ type (
42
+ AssignConsumerPubKeyAction = e2e.AssignConsumerPubKeyAction
43
+ )
44
+
40
45
type SendTokensAction struct {
41
46
Chain ChainID
42
47
From ValidatorID
@@ -1971,11 +1976,11 @@ func (tr Chain) relayPacketsHermes(
1971
1976
action RelayPacketsAction ,
1972
1977
verbose bool ,
1973
1978
) {
1974
- // Because `.app_state.provider.params.blocks_per_epoch` is set to 3 in the E2E tests, we wait 3 blocks
1979
+ // Because `.app_state.provider.params.blocks_per_epoch` is set to 3 in the E2E tests, we wait 4 blocks
1975
1980
// before relaying the packets to guarantee that at least one epoch passes and hence any `VSCPacket`s get
1976
1981
// queued and are subsequently relayed.
1977
- tr .waitBlocks (action .ChainA , 3 , 90 * time .Second )
1978
- tr .waitBlocks (action .ChainB , 3 , 90 * time .Second )
1982
+ tr .waitBlocks (action .ChainA , 4 , 90 * time .Second )
1983
+ tr .waitBlocks (action .ChainB , 4 , 90 * time .Second )
1979
1984
1980
1985
// hermes clear packets ibc0 transfer channel-13
1981
1986
cmd := tr .target .ExecCommand ("hermes" , "clear" , "packets" ,
@@ -1992,8 +1997,8 @@ func (tr Chain) relayPacketsHermes(
1992
1997
log .Fatal (err , "\n " , string (bz ))
1993
1998
}
1994
1999
1995
- tr .waitBlocks (action .ChainA , 1 , 30 * time .Second )
1996
- tr .waitBlocks (action .ChainB , 1 , 30 * time .Second )
2000
+ tr .waitBlocks (action .ChainA , 2 , 30 * time .Second )
2001
+ tr .waitBlocks (action .ChainB , 2 , 30 * time .Second )
1997
2002
}
1998
2003
1999
2004
type RelayRewardPacketsToProviderAction struct {
@@ -2349,7 +2354,7 @@ type UnjailValidatorAction struct {
2349
2354
// Sends an unjail transaction to the provider chain
2350
2355
func (tr Chain ) unjailValidator (action UnjailValidatorAction , verbose bool ) {
2351
2356
// wait until downtime_jail_duration has elapsed, to make sure the validator can be unjailed
2352
- tr .WaitTime (61 * time .Second )
2357
+ tr .WaitTime (65 * time .Second )
2353
2358
2354
2359
cmd := tr .target .ExecCommand (
2355
2360
tr .testConfig .chainConfigs [action .Provider ].BinaryName ,
@@ -2611,7 +2616,7 @@ func (tr Chain) invokeDoublesignSlash(
2611
2616
if err != nil {
2612
2617
log .Fatal (err , "\n " , string (bz ))
2613
2618
}
2614
- tr .waitBlocks ("provi" , 20 , 4 * time .Minute )
2619
+ tr .waitBlocks ("provi" , 25 , 4 * time .Minute )
2615
2620
} else { // tr.useCometMock
2616
2621
validatorPrivateKeyAddress := tr .GetValidatorPrivateKeyAddress (action .Chain , action .Validator )
2617
2622
@@ -2701,18 +2706,7 @@ func (tr Chain) lightClientAttack(
2701
2706
tr .waitBlocks (chain , 1 , 10 * time .Second )
2702
2707
}
2703
2708
2704
- type AssignConsumerPubKeyAction struct {
2705
- Chain ChainID
2706
- Validator ValidatorID
2707
- ConsumerPubkey string
2708
- // ReconfigureNode will change keys the node uses and restart
2709
- ReconfigureNode bool
2710
- // executing the action should raise an error
2711
- ExpectError bool
2712
- ExpectedError string
2713
- }
2714
-
2715
- func (tr Chain ) assignConsumerPubKey (action AssignConsumerPubKeyAction , verbose bool ) {
2709
+ func (tr Chain ) assignConsumerPubKey (action e2e.AssignConsumerPubKeyAction , verbose bool ) {
2716
2710
valCfg := tr .testConfig .validatorConfigs [action .Validator ]
2717
2711
2718
2712
// Note: to get error response reported back from this command '--gas auto' needs to be set.
@@ -2722,28 +2716,12 @@ func (tr Chain) assignConsumerPubKey(action AssignConsumerPubKeyAction, verbose
2722
2716
gas = "9000000"
2723
2717
}
2724
2718
2725
- assignKey := fmt .Sprintf (
2726
- `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas %s --keyring-backend test -y -o json` ,
2727
- tr .testConfig .chainConfigs [ChainID ("provi" )].BinaryName ,
2728
- string (tr .testConfig .chainConfigs [action .Chain ].ConsumerId ),
2729
- action .ConsumerPubkey ,
2730
- action .Validator ,
2731
- tr .testConfig .chainConfigs [ChainID ("provi" )].ChainId ,
2719
+ bz , err := tr .target .AssignConsumerPubKey (action , gas ,
2732
2720
tr .getValidatorHome (ChainID ("provi" ), action .Validator ),
2733
2721
tr .getValidatorNode (ChainID ("provi" ), action .Validator ),
2734
- gas ,
2722
+ verbose ,
2735
2723
)
2736
2724
2737
- cmd := tr .target .ExecCommand (
2738
- "/bin/bash" , "-c" ,
2739
- assignKey ,
2740
- )
2741
-
2742
- if verbose {
2743
- fmt .Println ("assignConsumerPubKey cmd:" , cmd .String ())
2744
- }
2745
-
2746
- bz , err := cmd .CombinedOutput ()
2747
2725
if err != nil && ! action .ExpectError {
2748
2726
log .Fatalf ("unexpected error during key assignment - output: %s, err: %s" , string (bz ), err )
2749
2727
}
@@ -3112,3 +3090,28 @@ func (tr Chain) AdvanceTimeForChain(chain ChainID, duration time.Duration) {
3112
3090
// wait for 1 block of the chain to get a block with the advanced timestamp
3113
3091
tr .waitBlocks (chain , 1 , time .Minute )
3114
3092
}
3093
+
3094
+ func (tr Commands ) AssignConsumerPubKey (action e2e.AssignConsumerPubKeyAction , gas , home , node string , verbose bool ) ([]byte , error ) {
3095
+ assignKey := fmt .Sprintf (
3096
+ `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas %s --keyring-backend test -y -o json` ,
3097
+ tr .chainConfigs [ChainID ("provi" )].BinaryName ,
3098
+ string (tr .chainConfigs [action .Chain ].ConsumerId ),
3099
+ action .ConsumerPubkey ,
3100
+ action .Validator ,
3101
+ tr .chainConfigs [ChainID ("provi" )].ChainId ,
3102
+ home ,
3103
+ node ,
3104
+ gas ,
3105
+ )
3106
+
3107
+ cmd := tr .target .ExecCommand (
3108
+ "/bin/bash" , "-c" ,
3109
+ assignKey ,
3110
+ )
3111
+
3112
+ if verbose {
3113
+ fmt .Println ("assignConsumerPubKey cmd:" , cmd .String ())
3114
+ }
3115
+
3116
+ return cmd .CombinedOutput ()
3117
+ }
0 commit comments