Add Snapshot field to new proposal yaml

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

@ -123,6 +123,7 @@ type NewProposalYaml struct {
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