Skip to content

Commit

Permalink
fix #255 (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuttyYang authored May 29, 2021
1 parent ae1e97f commit 979e58f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 9 additions & 5 deletions pkg/governance/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}

Expand Down Expand Up @@ -68,7 +71,7 @@ type ProposalIPFSMsg struct {
}

type ProposalVoteMsgPayload struct {
Choice int `json:"choice"`
Choice int `json:"choice,string"`
Proposal string `json:"proposal"`
}

Expand Down Expand Up @@ -143,6 +146,7 @@ type NewProposalJson struct {
} `json:"params"`
} `json:"strategies"`
} `json:"metadata"`
MaxCanSelect int `json:"maxCanSelect"`
} `json:"payload"`
}

Expand Down
7 changes: 4 additions & 3 deletions pkg/governance/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -135,7 +135,8 @@ var proposalTemplate = []byte(`{
}
}
]
}
},
"maxCanSelect": 1
}
}`)

Expand Down

0 comments on commit 979e58f

Please sign in to comment.