diff --git a/precompiles/assets/types.go b/precompiles/assets/types.go index bc016947c..393f6d2ca 100644 --- a/precompiles/assets/types.go +++ b/precompiles/assets/types.go @@ -193,6 +193,7 @@ func (p Precompile) TokenFromInputs(ctx sdk.Context, args []interface{}) (types. if len(chainDesc) == 2 { oracleInfo.Chain.Desc = chainDesc[1] } + fallthrough case l >= 5: oracleInfo.Token.Contract = parsed[4] fallthrough diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index f0eab0c76..3131b9f76 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -16,7 +16,7 @@ const ( func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ParamsKey) // return types.NewParams() + bz := store.Get(types.ParamsKey) if bz != nil { k.cdc.MustUnmarshal(bz, ¶ms) } @@ -55,12 +55,12 @@ func (k Keeper) RegisterNewTokenAndSetTokenFeeder(ctx sdk.Context, oInfo *types. if err != nil { return err } - if decimalInt < 0 { - return fmt.Errorf("decimal can't be negative:%d", decimalInt) - } - intervalInt, err := strconv.ParseUint(oInfo.Feeder.Interval, 10, 64) - if err != nil { - return err + intervalInt := uint64(0) + if len(oInfo.Feeder.Interval) > 0 { + intervalInt, err = strconv.ParseUint(oInfo.Feeder.Interval, 10, 64) + if err != nil { + return err + } } if intervalInt == 0 { intervalInt = defaultInterval