2021-06-02 17:03:25 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
|
|
|
|
"github.com/kava-labs/kava/x/kavadist/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ParseCommunityPoolMultiSpendProposalJSON reads and parses a CommunityPoolMultiSpendProposalJSON from a file.
|
2022-01-08 00:39:27 +00:00
|
|
|
func ParseCommunityPoolMultiSpendProposalJSON(cdc codec.JSONCodec, proposalFile string) (types.CommunityPoolMultiSpendProposalJSON, error) {
|
|
|
|
proposal := types.CommunityPoolMultiSpendProposalJSON{}
|
2021-06-02 17:03:25 +00:00
|
|
|
contents, err := ioutil.ReadFile(proposalFile)
|
|
|
|
if err != nil {
|
|
|
|
return proposal, err
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := cdc.UnmarshalJSON(contents, &proposal); err != nil {
|
|
|
|
return proposal, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return proposal, nil
|
|
|
|
}
|