Fix up ibc to work with new cli reorg
This commit is contained in:
parent
8659c4db68
commit
9b099a2f36
|
@ -16,6 +16,7 @@ var (
|
|||
errUnknownTxType = fmt.Errorf("Tx type unknown")
|
||||
errInvalidFormat = fmt.Errorf("Invalid format")
|
||||
errUnknownModule = fmt.Errorf("Unknown module")
|
||||
errUnknownKey = fmt.Errorf("Unknown key")
|
||||
|
||||
internalErr = abci.CodeType_InternalError
|
||||
encodingErr = abci.CodeType_EncodingError
|
||||
|
@ -39,7 +40,7 @@ func unwrap(i interface{}) interface{} {
|
|||
|
||||
func ErrUnknownTxType(tx interface{}) TMError {
|
||||
msg := fmt.Sprintf("%T", unwrap(tx))
|
||||
return WithMessage(msg, errUnknownTxType, abci.CodeType_UnknownRequest)
|
||||
return WithMessage(msg, errUnknownTxType, unknownRequest)
|
||||
}
|
||||
func IsUnknownTxTypeErr(err error) bool {
|
||||
return IsSameError(errUnknownTxType, err)
|
||||
|
@ -47,19 +48,26 @@ func IsUnknownTxTypeErr(err error) bool {
|
|||
|
||||
func ErrInvalidFormat(expected string, tx interface{}) TMError {
|
||||
msg := fmt.Sprintf("%T not %s", unwrap(tx), expected)
|
||||
return WithMessage(msg, errInvalidFormat, abci.CodeType_UnknownRequest)
|
||||
return WithMessage(msg, errInvalidFormat, unknownRequest)
|
||||
}
|
||||
func IsInvalidFormatErr(err error) bool {
|
||||
return IsSameError(errInvalidFormat, err)
|
||||
}
|
||||
|
||||
func ErrUnknownModule(mod string) TMError {
|
||||
return WithMessage(mod, errUnknownModule, abci.CodeType_UnknownRequest)
|
||||
return WithMessage(mod, errUnknownModule, unknownRequest)
|
||||
}
|
||||
func IsUnknownModuleErr(err error) bool {
|
||||
return IsSameError(errUnknownModule, err)
|
||||
}
|
||||
|
||||
func ErrUnknownKey(mod string) TMError {
|
||||
return WithMessage(mod, errUnknownKey, unknownRequest)
|
||||
}
|
||||
func IsUnknownKeyErr(err error) bool {
|
||||
return IsSameError(errUnknownKey, err)
|
||||
}
|
||||
|
||||
func ErrInternal(msg string) TMError {
|
||||
return New(msg, internalErr)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ var (
|
|||
errNoOutputs = fmt.Errorf("No output coins")
|
||||
errInvalidAddress = fmt.Errorf("Invalid address")
|
||||
errInvalidCoins = fmt.Errorf("Invalid coins")
|
||||
errUnknownKey = fmt.Errorf("Unknown key")
|
||||
|
||||
invalidInput = abci.CodeType_BaseInvalidInput
|
||||
invalidOutput = abci.CodeType_BaseInvalidOutput
|
||||
|
@ -80,10 +79,3 @@ func ErrNoOutputs() errors.TMError {
|
|||
func IsNoOutputsErr(err error) bool {
|
||||
return errors.IsSameError(errNoOutputs, err)
|
||||
}
|
||||
|
||||
func ErrUnknownKey(mod string) errors.TMError {
|
||||
return errors.WithMessage(mod, errUnknownKey, unknownRequest)
|
||||
}
|
||||
func IsUnknownKeyErr(err error) bool {
|
||||
return errors.IsSameError(errUnknownKey, err)
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ func (h Handler) SetOption(l log.Logger, store state.SimpleDB, module, key, valu
|
|||
return "Success", nil
|
||||
|
||||
}
|
||||
return "", ErrUnknownKey(key)
|
||||
return "", errors.ErrUnknownKey(key)
|
||||
}
|
||||
|
||||
func checkTx(ctx basecoin.Context, tx basecoin.Tx) (send SendTx, err error) {
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
merkle "github.com/tendermint/merkleeyes/iavl"
|
||||
|
||||
"github.com/tendermint/basecoin"
|
||||
"github.com/tendermint/basecoin/errors"
|
||||
)
|
||||
|
||||
// nolint
|
||||
|
@ -94,11 +93,8 @@ type CreatePacketTx struct {
|
|||
// ValidateBasic makes sure this is consistent - used to satisfy TxInner
|
||||
func (p CreatePacketTx) ValidateBasic() error {
|
||||
if p.DestChain == "" {
|
||||
return errors.ErrNoChain()
|
||||
return ErrWrongDestChain(p.DestChain)
|
||||
}
|
||||
// if len(p.Permissions) == 0 {
|
||||
// return ErrNoPermissions()
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue