fix: rawlog JSON formatting of proposal_vote option field (#16231)
This commit is contained in:
parent
05cf82474f
commit
bda51f2311
@ -245,6 +245,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (x/crypto) [#15258](https://github.com/cosmos/cosmos-sdk/pull/15258) Write keyhash file with permissions 0600 instead of 0555.
|
||||
* (cli) [#16138](https://github.com/cosmos/cosmos-sdk/pull/16138) Fix snapshot commands panic if snapshot don't exists.
|
||||
* (types) [#16145](https://github.com/cosmos/cosmos-sdk/pull/16145) Rename interface `ExtensionOptionI` back to `TxExtensionOptionI` to avoid breaking change.
|
||||
* (x/gov) [#16230](https://github.com/cosmos/cosmos-sdk/pull/16231) Fix: rawlog JSON formatting of proposal_vote option field
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@ -92,12 +93,9 @@ func ValidWeightedVoteOption(option WeightedVoteOption) bool {
|
||||
// WeightedVoteOptions describes array of WeightedVoteOptions
|
||||
type WeightedVoteOptions []*WeightedVoteOption
|
||||
|
||||
func (v WeightedVoteOptions) String() (out string) {
|
||||
for _, opt := range v {
|
||||
out += opt.String() + "\n"
|
||||
}
|
||||
|
||||
return strings.TrimSpace(out)
|
||||
func (v WeightedVoteOptions) String() string {
|
||||
out, _ := json.Marshal(v)
|
||||
return string(out)
|
||||
}
|
||||
|
||||
// VoteOptionFromString returns a VoteOption from a string. It returns an error
|
||||
|
||||
Loading…
Reference in New Issue
Block a user