Add Snapshot field to new proposal yaml

pull/276/head
hsiung 3 years ago committed by Leo Chen
parent 857736c1c5
commit d06268fa82
  1. 15
      pkg/governance/cli.go

@ -117,12 +117,13 @@ func PrintViewProposal(proposalHash string) error {
}
type NewProposalYaml struct {
Space string `yaml:"space"`
Start time.Time `yaml:"start"`
End time.Time `yaml:"end"`
Choices []string `yaml:"choices"`
Title string `yaml:"title"`
Body string `yaml:"body"`
Space string `yaml:"space"`
Start time.Time `yaml:"start"`
End time.Time `yaml:"end"`
Choices []string `yaml:"choices"`
Title string `yaml:"title"`
Body string `yaml:"body"`
Snapshot int `yaml:"snapshot"`
}
var proposalTemplate = []byte(`{
@ -172,7 +173,7 @@ func NewProposal(keyStore *keystore.KeyStore, account accounts.Account, proposal
proposalJson.Payload.Choices = proposalYaml.Choices
proposalJson.Payload.Start = float64(proposalYaml.Start.Unix())
proposalJson.Payload.End = float64(proposalYaml.End.Unix())
proposalJson.Payload.Snapshot = rand.Intn(9999999) + 1
proposalJson.Payload.Snapshot = proposalYaml.Snapshot
if !checkPermission(proposalJson.Space, account) {
return fmt.Errorf("no permission!")

Loading…
Cancel
Save