mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-15 04:25:27 +00:00
25 lines
642 B
Go
25 lines
642 B
Go
package cli
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
"github.com/0glabs/0g-chain/x/kavadist/types"
|
|
)
|
|
|
|
// ParseCommunityPoolMultiSpendProposalJSON reads and parses a CommunityPoolMultiSpendProposalJSON from a file.
|
|
func ParseCommunityPoolMultiSpendProposalJSON(cdc codec.JSONCodec, proposalFile string) (types.CommunityPoolMultiSpendProposalJSON, error) {
|
|
proposal := types.CommunityPoolMultiSpendProposalJSON{}
|
|
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
|
|
}
|