@@ -495,7 +495,7 @@ func (tr Chain) UpdateConsumer(providerChain ChainID, validator ValidatorID, upd
495
495
bz , err = cmd .CombinedOutput ()
496
496
if err != nil {
497
497
fmt .Println ("command failed: " , cmd )
498
- log .Fatal ("update consumer failed error: %w , output: %s" , err , string (bz ))
498
+ log .Fatalf ("update consumer failed error: %s , output: %s" , err , string (bz ))
499
499
}
500
500
501
501
// Check transaction
@@ -2536,14 +2536,14 @@ func (tr Chain) registerRepresentative(
2536
2536
2537
2537
type SubmitChangeRewardDenomsProposalAction struct {
2538
2538
Chain ChainID
2539
- Denom string
2539
+ Denoms [] string
2540
2540
Deposit uint
2541
2541
From ValidatorID
2542
2542
}
2543
2543
2544
2544
func (tr Chain ) submitChangeRewardDenomsProposal (action SubmitChangeRewardDenomsProposalAction , verbose bool ) {
2545
2545
changeRewMsg := types.MsgChangeRewardDenoms {
2546
- DenomsToAdd : [] string { action .Denom } ,
2546
+ DenomsToAdd : action .Denoms ,
2547
2547
DenomsToRemove : []string {"stake" },
2548
2548
Authority : "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" ,
2549
2549
}
@@ -2604,7 +2604,7 @@ func (tr Chain) submitChangeRewardDenomsLegacyProposal(action SubmitChangeReward
2604
2604
ChangeRewardDenomsProposal : types.ChangeRewardDenomsProposal {
2605
2605
Title : "Change reward denoms" ,
2606
2606
Description : "Change reward denoms" ,
2607
- DenomsToAdd : [] string { action .Denom } ,
2607
+ DenomsToAdd : action .Denoms ,
2608
2608
DenomsToRemove : []string {"stake" },
2609
2609
},
2610
2610
Deposit : fmt .Sprint (action .Deposit ) + `stake` ,
@@ -3309,3 +3309,95 @@ func (tr Commands) AssignConsumerPubKey(action e2e.AssignConsumerPubKeyAction, g
3309
3309
3310
3310
return cmd .CombinedOutput ()
3311
3311
}
3312
+
3313
+ type CreateIbcClientAction struct {
3314
+ ChainA ChainID
3315
+ ChainB ChainID
3316
+ }
3317
+
3318
+ func (tr Chain ) createIbcClientHermes (
3319
+ action CreateIbcClientAction ,
3320
+ verbose bool ,
3321
+ ) {
3322
+ cmd := tr .target .ExecCommand ("hermes" ,
3323
+ "create" , "client" ,
3324
+ "--host-chain" , string (tr .testConfig .chainConfigs [action .ChainA ].ChainId ),
3325
+ "--reference-chain" , string (tr .testConfig .chainConfigs [action .ChainB ].ChainId ),
3326
+ "--trusting-period" , "1200000s" ,
3327
+ )
3328
+
3329
+ cmdReader , err := cmd .StdoutPipe ()
3330
+ if err != nil {
3331
+ log .Fatal (err )
3332
+ }
3333
+ cmd .Stderr = cmd .Stdout
3334
+
3335
+ if err := cmd .Start (); err != nil {
3336
+ log .Fatal (err )
3337
+ }
3338
+
3339
+ scanner := bufio .NewScanner (cmdReader )
3340
+
3341
+ for scanner .Scan () {
3342
+ out := scanner .Text ()
3343
+ if verbose {
3344
+ fmt .Println ("createIbcClientHermes: " + out )
3345
+ }
3346
+ if out == done {
3347
+ break
3348
+ }
3349
+ }
3350
+ if err := scanner .Err (); err != nil {
3351
+ log .Fatal (err )
3352
+ }
3353
+ }
3354
+
3355
+ type TransferIbcTokenAction struct {
3356
+ Chain ChainID
3357
+ DstAddr string
3358
+ From ValidatorID
3359
+ Amount uint
3360
+ Channel uint
3361
+ Memo string
3362
+ }
3363
+
3364
+ func (tr Chain ) transferIbcToken (
3365
+ action TransferIbcTokenAction ,
3366
+ verbose bool ,
3367
+ ) {
3368
+ // Note: to get error response reported back from this command '--gas auto' needs to be set.
3369
+ gas := "auto"
3370
+
3371
+ transferCmd := fmt .Sprintf (
3372
+ `%s tx ibc-transfer transfer transfer \
3373
+ %s %s %s --memo %q --from validator%s --chain-id %s \
3374
+ --home %s --node %s --gas %s --keyring-backend test -y -o json` ,
3375
+ tr .testConfig .chainConfigs [action .Chain ].BinaryName ,
3376
+ "channel-" + fmt .Sprint (action .Channel ),
3377
+ action .DstAddr ,
3378
+ fmt .Sprint (action .Amount )+ `stake` ,
3379
+ action .Memo ,
3380
+ action .From ,
3381
+ string (tr .testConfig .chainConfigs [action .Chain ].ChainId ),
3382
+ tr .getValidatorHome (action .Chain , action .From ),
3383
+ tr .getValidatorNode (action .Chain , action .From ),
3384
+ gas ,
3385
+ )
3386
+
3387
+ cmd := tr .target .ExecCommand (
3388
+ "/bin/bash" , "-c" ,
3389
+ transferCmd ,
3390
+ )
3391
+
3392
+ if verbose {
3393
+ fmt .Println ("transferIbcToken cmd:" , cmd .String ())
3394
+ }
3395
+
3396
+ bz , err := cmd .CombinedOutput ()
3397
+ if err != nil {
3398
+ log .Fatalf ("unexpected error during IBC token transfer: %s: %s" , string (bz ), err )
3399
+ }
3400
+
3401
+ // wait for inclusion in a block -> '--broadcast-mode block' is deprecated
3402
+ tr .waitBlocks (action .Chain , 2 , 30 * time .Second )
3403
+ }
0 commit comments