func ToRosetta(err error) *types.Error {
	if err == nil {
		return nil
	}
	rosErr, ok := err.(*Error)
	if !ok {
		return ToRosetta(WrapError(ErrUnknown, err.Error()))
	}
	return rosErr.rosErr
}
ToRosetta attempts to converting an error into a rosetta
error, if the error cannot be converted it will be parsed as unknown
package errors
import (
	"fmt"
	grpccodes "google.golang.org/grpc/codes"
	grpcstatus "google.golang.org/grpc/status"
	"github.com/coinbase/rosetta-sdk-go/types"
)
func ListErrors() []*types.Error {
	return registry.list()
}
func SealAndListErrors() []*types.Error {
	registry.seal()
	return registry.list()
}
type Error struct {
	rosErr *types.Error
}
func (e *Error) Error() string {
	if e.rosErr == nil {
		return ErrUnknown.Error()
	}
	return fmt.Sprintf("rosetta: (%d) %s", e.rosErr.Code, e.rosErr.Message)
}
func (e *Error) Is(err error) bool {
	if (e == nil && err != nil) || (err == nil && e != nil) {
		return false
	}
	rosErr, ok := err.(*Error)
	if !ok {
		return false
	}
	if (rosErr.rosErr == nil && e.rosErr != nil) || (e.rosErr == nil && rosErr.rosErr != nil) {
		return false
	}
	return rosErr.rosErr.Code == e.rosErr.Code
}
func WrapError(err *Error, msg string) *Error {
	return &Error{rosErr: &types.Error{
		Code:        err.rosErr.Code,
		Message:     err.rosErr.Message,
		Description: err.rosErr.Description,
		Retriable:   err.rosErr.Retriable,
		Details: map[string]interface{}{
			"info": msg,
		},
	}}
}