2021-06-02 17:03:25 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
"github.com/0glabs/0g-chain/x/kavadist/types"
|
2021-06-02 17:03:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|