-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8844 from Agoric/mhofman/8843-core-proposal-upgra…
…de-handler Core proposals in upgrade handler
- Loading branch information
Showing
4 changed files
with
93 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package vm | ||
|
||
// CoreProposalStep is a set of core proposal configs which are executed | ||
// concurrently | ||
type CoreProposalStep []Jsonable | ||
|
||
// CoreProposals is one possible shape for core proposals expressed as a series | ||
// of sequential steps | ||
// see SequentialCoreProposals in packages/deploy-script-support/src/extract-proposal.js | ||
type CoreProposals struct { | ||
Steps []CoreProposalStep `json:"steps"` | ||
} | ||
|
||
// CoreProposalStepForModules generates a single core proposal step from | ||
// the given modules, which will be executed concurrently during that step | ||
func CoreProposalStepForModules(modules ...string) CoreProposalStep { | ||
step := make([]Jsonable, len(modules)) | ||
for i := range modules { | ||
step[i] = modules[i] | ||
} | ||
return step | ||
} | ||
|
||
// CoreProposalsFromSteps returns a CoreProposals from the given steps | ||
func CoreProposalsFromSteps(steps ...CoreProposalStep) *CoreProposals { | ||
if steps == nil { | ||
// Deal with https://github.com/golang/go/issues/37711 | ||
return &CoreProposals{Steps: []CoreProposalStep{}} | ||
} | ||
return &CoreProposals{Steps: steps} | ||
} |
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