Skip to content

Commit

Permalink
removed ConsumerUpdateProposal
Browse files Browse the repository at this point in the history
  • Loading branch information
bermuell committed Sep 3, 2024
1 parent bc8b6f0 commit 61c853e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
4 changes: 3 additions & 1 deletion tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (tr Chain) UpdateConsumer(providerChain ChainID, validator ValidatorID, upd
if txResponse.Code != 0 {
log.Fatalf("sending update-consumer transaction failed with error code %d, Log:'%s'", txResponse.Code, txResponse.RawLog)
}
tr.waitBlocks(ChainID("provi"), 2, 10*time.Second)
tr.waitBlocks(providerChain, 2, 10*time.Second)
}

// CreateConsumer creates a consumer chain and returns its consumer-id
Expand Down Expand Up @@ -503,6 +503,7 @@ func (tr Chain) CreateConsumer(providerChain, consumerChain ChainID, validator V
log.Fatalf("not able to query tx containing creation-consumer: tx: %s, err: %s, out: %s",
txResponse.TxHash, err.Error(), string(bz))
}
fmt.Println("@@@@ created consumer chain tx=", txResponse.TxHash)

err = json.Unmarshal(bz, txResponse)
if err != nil {
Expand Down Expand Up @@ -592,6 +593,7 @@ func (tr Chain) submitConsumerAdditionProposal(
// - set PowerShaping params TopN > 0 for consumer chain
update.PowerShapingParameters.Top_N = action.TopN
update.Signer = authority
update.NewOwnerAddress = ""
update.InitializationParameters = &InitializationParameters
update.InitializationParameters.SpawnTime = spawnTime
update.Metadata = &Metadata
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ type TestConfig struct {
timeOffset time.Duration
transformGenesis bool
name string
Consumer2ChainID map[ConsumerID]ChainID // dynamic mapping of
}

// Initialize initializes the TestConfig instance by setting the runningChains field to an empty map.
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type (
Rewards = e2e.Rewards
TextProposal = e2e.TextProposal
UpgradeProposal = e2e.UpgradeProposal
ConsumerUpdateProposal = e2e.ConsumerUpdateProposal
ConsumerAdditionProposal = e2e.ConsumerAdditionProposal
ConsumerRemovalProposal = e2e.ConsumerRemovalProposal
ConsumerModificationProposal = e2e.ConsumerModificationProposal
Expand Down Expand Up @@ -477,7 +476,7 @@ func (tr Commands) GetProposal(chain ChainID, proposal uint) Proposal {
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning test

Iteration over map may be a possible source of non-determinism

updateProposal := e2e.ConsumerUpdateProposal{
updateProposal := ConsumerAdditionProposal{
Deposit: uint(deposit),
Chain: consumerChainId,
Status: status,
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/steps_partial_set_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@ func stepsModifyChain() []Step {
State: State{
ChainID("provi"): ChainState{
Proposals: &map[uint]Proposal{
1: ConsumerUpdateProposal{
1: ConsumerAdditionProposal{
Deposit: 10000001,
Chain: ChainID("consu"),
Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)),
Expand All @@ -2189,7 +2189,7 @@ func stepsModifyChain() []Step {
State: State{
ChainID("provi"): ChainState{
Proposals: &map[uint]Proposal{
1: ConsumerUpdateProposal{
1: ConsumerAdditionProposal{
Deposit: 10000001,
Chain: ChainID("consu"),
Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)),
Expand Down
10 changes: 0 additions & 10 deletions tests/e2e/testlib/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,6 @@ type ConsumerAdditionProposal struct {
Status string
}

type ConsumerUpdateProposal struct {
Deposit uint
Chain ChainID
SpawnTime int
InitialHeight clienttypes.Height
Status string
}

type UpgradeProposal struct {
Title string
Description string
Expand All @@ -313,8 +305,6 @@ func (p UpgradeProposal) isProposal() {}

func (p ConsumerAdditionProposal) isProposal() {}

func (p ConsumerUpdateProposal) isProposal() {}

type ConsumerRemovalProposal struct {
Deposit uint
Chain ChainID
Expand Down

0 comments on commit 61c853e

Please sign in to comment.