func coinChangeToOutPoint(cc *rtypes.CoinChange) (wire.OutPoint, error) {
	if cc == nil {
		return wire.OutPoint{}, errNilCoinChange
	}
	if cc.CoinIdentifier == nil {
		return wire.OutPoint{}, errNilCoinChangeId
	}
	outp, err := decodeOutPoint(cc.CoinIdentifier.Identifier)
	if err != nil {
		return outp, err
	}
	return outp, nil
}
coinChangeToOutPoint decodes the given coin change into a wire OutPoint.
package types
import (
	"encoding/hex"
	"errors"
	"fmt"
	"strconv"
	"strings"
	rtypes "github.com/coinbase/rosetta-sdk-go/types"
	"github.com/decred/dcrd/chaincfg/chainhash"
	"github.com/decred/dcrd/chaincfg/v3"
	"github.com/decred/dcrd/dcrec/secp256k1/v3"
	"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa"
	"github.com/decred/dcrd/dcrutil/v3"
	"github.com/decred/dcrd/txscript/v3"
	"github.com/decred/dcrd/wire"
)
const sigHashType = txscript.SigHashAll
type errKeyNotFound string
func (e errKeyNotFound) Error() string {
	return fmt.Sprintf("key %s does not exist", string(e))
}
var (
	errIncorrectOutPointFormat = errors.New("string does not have outpoint format '<hex>:<index>''")
	errShortOutPointHex        = errors.New("hex part of outpoint does not encode 32 bytes")
	errInvalidOutPointHex      = errors.New("invalid hash at start of outpoint string")
	errInvalidOutPointInt      = errors.New("invalid int at end of outpoint string")
)
func decodeOutPoint(s string) (wire.OutPoint, error) {
	split := strings.Split(s, ":")
	var out wire.OutPoint
	if len(split) != 2 {
		return out, errIncorrectOutPointFormat
	}
	if len(split[0]) != 64 {
		return out, errShortOutPointHex
	}
	if err := chainhash.Decode(&out.Hash, split[0]); err != nil {
		return out, errInvalidOutPointHex
	}
	idx, err := strconv.ParseUint(split[1], 10, 32)
	if err != nil {
		return out, errInvalidOutPointInt
	}
	out.Index = uint32(idx)
	return out, nil
}
var (
	errNilCoinChange   = errors.New("coin_change must not be nil")
	errNilCoinChangeId = errors.New("coin_change.coin_identifier must not be nil")
)