-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: port
ConsumerRemovalProposal
handler to main (#429)
* Feat: add consumer removal proposal to proposal handler * remove comment * add integration tests * update integration tests * Delete .yarn-integrity * update tests after reviews * nits * other nit, good to approve Co-authored-by: Matija Salopek <matija.salopek994@gmail.com> Co-authored-by: Shawn Marshall-Spitzbart <44221603+smarshall-spitzbart@users.noreply.github.com> Co-authored-by: MSalopek <35486649+MSalopek@users.noreply.github.com> Co-authored-by: Jehan <jehan.tremback@gmail.com>
- Loading branch information
1 parent
36610e9
commit 9241d1f
Showing
10 changed files
with
336 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package main | ||
|
||
import "time" | ||
|
||
// submits a consumer-removal proposal and removes the chain | ||
func stepsStopChain(consumerName string) []Step { | ||
s := []Step{ | ||
{ | ||
action: submitConsumerRemovalProposalAction{ | ||
chain: chainID("provi"), | ||
from: validatorID("bob"), | ||
deposit: 10000001, | ||
consumerChain: chainID(consumerName), | ||
stopTimeOffset: 0 * time.Millisecond, | ||
}, | ||
state: State{ | ||
chainID("provi"): ChainState{ | ||
ValBalances: &map[validatorID]uint{ | ||
validatorID("bob"): 9490000001, | ||
}, | ||
Proposals: &map[uint]Proposal{ | ||
2: ConsumerRemovalProposal{ | ||
Deposit: 10000001, | ||
Chain: chainID(consumerName), | ||
StopTime: 0, | ||
Status: "PROPOSAL_STATUS_VOTING_PERIOD", | ||
}, | ||
}, | ||
ConsumerChains: &map[chainID]bool{"consu": true}, // consumer chain not yet removed | ||
}, | ||
}, | ||
}, | ||
{ | ||
action: voteGovProposalAction{ | ||
chain: chainID("provi"), | ||
from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, | ||
vote: []string{"yes", "yes", "yes"}, | ||
propNumber: 2, | ||
}, | ||
state: State{ | ||
chainID("provi"): ChainState{ | ||
Proposals: &map[uint]Proposal{ | ||
2: ConsumerRemovalProposal{ | ||
Deposit: 10000001, | ||
Chain: chainID(consumerName), | ||
StopTime: 0, | ||
Status: "PROPOSAL_STATUS_PASSED", | ||
}, | ||
}, | ||
ValBalances: &map[validatorID]uint{ | ||
validatorID("bob"): 9500000002, | ||
}, | ||
ConsumerChains: &map[chainID]bool{}, // Consumer chain is now removed | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
return s | ||
} |
Oops, something went wrong.