LuttyYang 4 years ago committed by GitHub
parent ae1e97fb51
commit 979e58f418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      pkg/governance/api.go
  2. 7
      pkg/governance/cli.go

@ -6,10 +6,9 @@ import (
)
type Space struct {
Name string `json:"name"`
Key string `json:"key"`
Network string `json:"network"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Key string `json:"key,omitempty"`
Symbol string `json:"symbol"`
}
func listSpaces() (spaces map[string]*Space, err error) {
@ -20,6 +19,10 @@ func listSpaces() (spaces map[string]*Space, err error) {
return nil, err
}
for k, space := range result {
space.Key = k
}
return result, nil
}
@ -68,7 +71,7 @@ type ProposalIPFSMsg struct {
}
type ProposalVoteMsgPayload struct {
Choice int `json:"choice"`
Choice int `json:"choice,string"`
Proposal string `json:"proposal"`
}
@ -143,6 +146,7 @@ type NewProposalJson struct {
} `json:"params"`
} `json:"strategies"`
} `json:"metadata"`
MaxCanSelect int `json:"maxCanSelect"`
} `json:"payload"`
}

@ -24,10 +24,10 @@ func PrintListSpace() error {
table := tablewriter.NewWriter(os.Stdout)
table.SetBorder(false)
table.SetHeader([]string{"Key", "Network", "Name"})
table.SetHeader([]string{"Key", "Name"})
for key, space := range spaces {
table.Append([]string{key, space.Network, space.Name})
table.Append([]string{key, space.Name})
}
table.Render()
@ -135,7 +135,8 @@ var proposalTemplate = []byte(`{
}
}
]
}
},
"maxCanSelect": 1
}
}`)

Loading…
Cancel
Save