Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bermuell committed Aug 30, 2024
1 parent c6671fc commit 542ad6f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ type UpdateConsumerChainAction struct {
Chain ChainID
From ValidatorID
ConsumerChain ChainID
NewOwner string
SpawnTime uint
InitialHeight clienttypes.Height
DistributionChannel string
Expand All @@ -272,18 +273,17 @@ type UpdateConsumerChainAction struct {
Denylist []string
MinStake uint64
AllowInactiveVals bool
NewOwner string
}

func (tr Chain) updateConsumerChain(action UpdateConsumerChainAction, verbose bool) {

spawn_time := tr.testConfig.containerConfig.Now.Add(time.Duration(action.SpawnTime) * time.Millisecond)
spawnTime := tr.testConfig.containerConfig.Now.Add(time.Duration(action.SpawnTime) * time.Millisecond)
params := ccvtypes.DefaultParams()
initParams := types.ConsumerInitializationParameters{
InitialHeight: action.InitialHeight,
GenesisHash: []byte("gen_hash"),
BinaryHash: []byte("bin_hash"),
SpawnTime: spawn_time,
SpawnTime: spawnTime,

UnbondingPeriod: params.UnbondingPeriod,
CcvTimeoutPeriod: params.CcvTimeoutPeriod,
Expand All @@ -304,9 +304,9 @@ func (tr Chain) updateConsumerChain(action UpdateConsumerChainAction, verbose bo
AllowInactiveVals: action.AllowInactiveVals,
}

consumerID := tr.testConfig.chainConfigs[action.ConsumerChain].ConsumerId
consumerId := tr.testConfig.chainConfigs[action.ConsumerChain].ConsumerId
update := types.MsgUpdateConsumer{
ConsumerId: string(consumerID),
ConsumerId: string(consumerId),
NewOwnerAddress: action.NewOwner,
InitializationParameters: &initParams,
PowerShapingParameters: &powerShapingParams,
Expand All @@ -318,8 +318,8 @@ type CreateConsumerChainAction struct {
Chain ChainID
From ValidatorID
ConsumerChain ChainID
SpawnTime uint
InitialHeight clienttypes.Height
SpawnTime uint
DistributionChannel string
TopN uint32
ValidatorsPowerCap uint32
Expand Down Expand Up @@ -392,8 +392,6 @@ type SubmitConsumerAdditionProposalAction struct {
}

func (tr Chain) UpdateConsumer(providerChain ChainID, validator ValidatorID, update types.MsgUpdateConsumer) {

fmt.Println("Update proposal for consumer_id=", update.ConsumerId)
content, err := json.Marshal(update)
if err != nil {
log.Fatalf("failed marshalling MsgUpdate", err.Error())
Expand All @@ -420,15 +418,11 @@ func (tr Chain) UpdateConsumer(providerChain ChainID, validator ValidatorID, upd
`-y`,
)

fmt.Println("Update Consumer", "cmd:", cmd.String(), "content:\n", string(content))

bz, err = cmd.CombinedOutput()
if err != nil {
log.Fatal("update consumer failed ", "error: ", err, "output: ", string(bz))
}

fmt.Println("update consumer", "output", string(bz))

// Check transaction
txResponse := &TxResponse{}
err = json.Unmarshal(bz, txResponse)
Expand Down

0 comments on commit 542ad6f

Please sign in to comment.