* codec: Rename codec and marshaler interfaces, ref: 8413 * codec: remove BinaryBare * changelog update * Update comments and documentation * adding doc string comments * Update CHANGELOG.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update codec/codec.go Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Marko <marbar3778@yahoo.com>
25 lines
657 B
Go
25 lines
657 B
Go
package cli
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
|
)
|
|
|
|
// ParseCommunityPoolSpendProposalWithDeposit reads and parses a CommunityPoolSpendProposalWithDeposit from a file.
|
|
func ParseCommunityPoolSpendProposalWithDeposit(cdc codec.JSONCodec, proposalFile string) (types.CommunityPoolSpendProposalWithDeposit, error) {
|
|
proposal := types.CommunityPoolSpendProposalWithDeposit{}
|
|
|
|
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
|
|
}
|