@@ -37,6 +37,11 @@ const (
3737 V300 = "v3.0.0"
3838)
3939
40+ // type aliases
41+ type (
42+ AssignConsumerPubKeyAction = e2e.AssignConsumerPubKeyAction
43+ )
44+
4045type SendTokensAction struct {
4146 Chain ChainID
4247 From ValidatorID
@@ -1971,11 +1976,11 @@ func (tr Chain) relayPacketsHermes(
19711976 action RelayPacketsAction ,
19721977 verbose bool ,
19731978) {
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
19751980 // before relaying the packets to guarantee that at least one epoch passes and hence any `VSCPacket`s get
19761981 // 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 )
19791984
19801985 // hermes clear packets ibc0 transfer channel-13
19811986 cmd := tr .target .ExecCommand ("hermes" , "clear" , "packets" ,
@@ -1992,8 +1997,8 @@ func (tr Chain) relayPacketsHermes(
19921997 log .Fatal (err , "\n " , string (bz ))
19931998 }
19941999
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 )
19972002}
19982003
19992004type RelayRewardPacketsToProviderAction struct {
@@ -2349,7 +2354,7 @@ type UnjailValidatorAction struct {
23492354// Sends an unjail transaction to the provider chain
23502355func (tr Chain ) unjailValidator (action UnjailValidatorAction , verbose bool ) {
23512356 // 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 )
23532358
23542359 cmd := tr .target .ExecCommand (
23552360 tr .testConfig .chainConfigs [action .Provider ].BinaryName ,
@@ -2611,7 +2616,7 @@ func (tr Chain) invokeDoublesignSlash(
26112616 if err != nil {
26122617 log .Fatal (err , "\n " , string (bz ))
26132618 }
2614- tr .waitBlocks ("provi" , 20 , 4 * time .Minute )
2619+ tr .waitBlocks ("provi" , 25 , 4 * time .Minute )
26152620 } else { // tr.useCometMock
26162621 validatorPrivateKeyAddress := tr .GetValidatorPrivateKeyAddress (action .Chain , action .Validator )
26172622
@@ -2701,18 +2706,7 @@ func (tr Chain) lightClientAttack(
27012706 tr .waitBlocks (chain , 1 , 10 * time .Second )
27022707}
27032708
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 ) {
27162710 valCfg := tr .testConfig .validatorConfigs [action .Validator ]
27172711
27182712 // 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
27222716 gas = "9000000"
27232717 }
27242718
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 ,
27322720 tr .getValidatorHome (ChainID ("provi" ), action .Validator ),
27332721 tr .getValidatorNode (ChainID ("provi" ), action .Validator ),
2734- gas ,
2722+ verbose ,
27352723 )
27362724
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 ()
27472725 if err != nil && ! action .ExpectError {
27482726 log .Fatalf ("unexpected error during key assignment - output: %s, err: %s" , string (bz ), err )
27492727 }
@@ -3112,3 +3090,28 @@ func (tr Chain) AdvanceTimeForChain(chain ChainID, duration time.Duration) {
31123090 // wait for 1 block of the chain to get a block with the advanced timestamp
31133091 tr .waitBlocks (chain , 1 , time .Minute )
31143092}
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