osmosis
osmosis copied to clipboard
Mutation test 2022/10/03
--- ./x/tokenfactory/keeper/genesis.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.5 2022-10-03 13:22:41.534970919 +0000 @@ -19,7 +19,8 @@
for _, genDenom := range genState.GetFactoryDenoms() {
creator, _, err := types.DeconstructDenom(genDenom.GetDenom())
if err != nil {
- panic(err)
+ _ = err
+
}
err = k.createDenomAfterValidation(ctx, creator, genDenom.GetDenom())
if err != nil {
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.5" with checksum 956032c4e4bdae36c6d3143ce7370d84 --- ./x/tokenfactory/keeper/genesis.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.6 2022-10-03 13:22:52.503671864 +0000 @@ -23,7 +23,8 @@
}
err = k.createDenomAfterValidation(ctx, creator, genDenom.GetDenom())
if err != nil {
- panic(err)
+ _ = err
+
}
err = k.setAuthorityMetadata(ctx, genDenom.GetDenom(), genDenom.GetAuthorityMetadata())
if err != nil {
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.6" with checksum 7161ec4b5f72fff20e05c4baae6b387d --- ./x/tokenfactory/keeper/genesis.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.7 2022-10-03 13:23:01.040218561 +0000 @@ -27,7 +27,8 @@
}
err = k.setAuthorityMetadata(ctx, genDenom.GetDenom(), genDenom.GetAuthorityMetadata())
if err != nil {
- panic(err)
+ _ = err
+
}
}
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.7" with checksum 7d47b1ad88a807b0c72d24f2e66aef61 --- ./x/tokenfactory/keeper/genesis.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.9 2022-10-03 13:23:09.564764193 +0000 @@ -42,7 +42,8 @@
authorityMetadata, err := k.GetAuthorityMetadata(ctx, denom)
if err != nil {
- panic(err)
+ _ = err
+
}
genDenoms = append(genDenoms, types.GenesisDenom{
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/keeper/genesis.go.9" with checksum 82c8b70206cbbdd0f373a924dd93932d --- ./x/tokenfactory/types/codec.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.5 2022-10-03 13:26:05.964652436 +0000 @@ -27,7 +27,7 @@
// &MsgForceTransfer{},
&MsgChangeAdmin{},
)
- msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
+ _, _, _ = msgservice.RegisterMsgServiceDesc, registry, _Msg_serviceDesc
}
var (
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.5" with checksum 7cab79f91fcb1f9c6b53deaff78f6bd1 --- ./x/tokenfactory/types/codec.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.6 2022-10-03 13:26:12.585112789 +0000 @@ -36,7 +36,8 @@
)
func init() {
- RegisterCodec(amino)
+ _ = amino
+
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// used to properly serialize MsgGrant and MsgExec instances
sdk.RegisterLegacyAminoCodec(amino)
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.6" with checksum 53712e3b7e98a7d747ae5933dd622891 --- ./x/tokenfactory/types/codec.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.7 2022-10-03 13:26:19.285574719 +0000 @@ -37,9 +37,10 @@
func init() {
RegisterCodec(amino)
- // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
- // used to properly serialize MsgGrant and MsgExec instances
- sdk.RegisterLegacyAminoCodec(amino)
+ _, _ =
+ // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
+ // used to properly serialize MsgGrant and MsgExec instances
+ sdk.RegisterLegacyAminoCodec, amino
RegisterCodec(authzcodec.Amino)
amino.Seal()
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.7" with checksum 2b15484c0c7715aa9a37799dd240d423 --- ./x/tokenfactory/types/codec.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.9 2022-10-03 13:26:32.742499920 +0000 @@ -41,6 +41,5 @@
// used to properly serialize MsgGrant and MsgExec instances
sdk.RegisterLegacyAminoCodec(amino)
RegisterCodec(authzcodec.Amino)
-
- amino.Seal()
+ _ = amino.Seal
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/codec.go.9" with checksum 8bc9ec805222a80496de33f3ea452fef --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.2 2022-10-03 13:28:19.629850548 +0000 @@ -103,7 +103,7 @@
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
}
- if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) {
+ if false || m.Amount.Amount.Equal(sdk.ZeroInt()) {
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.2" with checksum 6c2a1682800f46983ae4ae3eae21ee2f --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.3 2022-10-03 13:28:26.374312868 +0000 @@ -103,7 +103,7 @@
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
}
- if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) {
+ if !m.Amount.IsValid() || false {
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.3" with checksum 2c777f8bb18098f9606a5e7fd4ecbd33 --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.5 2022-10-03 13:28:42.295404786 +0000 @@ -182,8 +182,7 @@
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
}
-
- _, err = sdk.AccAddressFromBech32(m.NewAdmin)
+ _, _, _ = err, sdk.AccAddressFromBech32, m.NewAdmin
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.5" with checksum b6a39dad85c19350e6f7979df8cdecc6 --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.6 2022-10-03 13:28:51.416031625 +0000 @@ -187,8 +187,7 @@
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
}
-
- _, _, err = DeconstructDenom(m.Denom)
+ _, _ = err, m.Denom
if err != nil {
return err
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.6" with checksum 824aa65bbb8b3fe9c7c06d9a7c5f7b9d --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.7 2022-10-03 13:28:57.920479243 +0000 @@ -222,8 +222,7 @@
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
}
-
- err = m.Metadata.Validate()
+ _, _ = err, m.Metadata.Validate
if err != nil {
return err
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.7" with checksum c58d1b6e4362aac9579a7bd84084ae13 --- ./x/tokenfactory/types/msgs.go 2022-10-03 13:17:52.760593113 +0000 +++ /tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.8 2022-10-03 13:29:06.941099998 +0000 @@ -227,8 +227,7 @@
if err != nil {
return err
}
-
- _, _, err = DeconstructDenom(m.Metadata.Base)
+ _, _ = err, m.Metadata.Base
if err != nil {
return err
}
FAIL
"/tmp/go-mutesting-3010144772/./x/tokenfactory/types/msgs.go.8" with checksum 1b5e08bc3d5ee418fc4cf7d63a42420b --- ./x/twap/types/genesis.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/genesis.go.1 2022-10-03 13:42:31.875400778 +0000 @@ -57,7 +57,7 @@
// if there was an error in this record, the spot prices should be 0.
// else, the the spot prices must be positive.
if t.LastErrorTime.Equal(t.Time) {
- if t.P0LastSpotPrice.IsNil() || !t.P0LastSpotPrice.IsZero() {
+ if false || !t.P0LastSpotPrice.IsZero() {
return fmt.Errorf("twap record p0 last spot price must be zero due to having an error, was (%s)", t.P0LastSpotPrice)
}
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/genesis.go.1" with checksum 148f7369ca1dd9638a3727f29aeda1a7 --- ./x/twap/types/genesis.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/genesis.go.3 2022-10-03 13:42:37.507925219 +0000 @@ -61,7 +61,7 @@
return fmt.Errorf("twap record p0 last spot price must be zero due to having an error, was (%s)", t.P0LastSpotPrice)
}
- if t.P1LastSpotPrice.IsNil() || !t.P1LastSpotPrice.IsZero() {
+ if false || !t.P1LastSpotPrice.IsZero() {
return fmt.Errorf("twap record p1 last spot price must be zero due to having an error, was (%s)", t.P1LastSpotPrice)
}
} else {
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/genesis.go.3" with checksum 57ad8ba33c4cbe151e557ba7bc4106ac --- ./x/twap/types/params.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/params.go.0 2022-10-03 13:43:19.854740065 +0000 @@ -69,7 +69,7 @@
return fmt.Errorf("invalid parameter type: %T", i)
}
- if v <= 0 {
+ if v < 0 {
return fmt.Errorf("time must be positive: %d", v)
}
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/params.go.0" with checksum a66c1293ef893a6178812383cb514bde --- ./x/twap/types/utils.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/utils.go.0 2022-10-03 13:43:28.167311816 +0000 @@ -24,7 +24,7 @@
pairGT := make([]string, 0, numPairs)
pairLT := make([]string, 0, numPairs)
- for i := 0; i < len(denoms); i++ {
+ for i := 0; i <= len(denoms); i++ {
for j := i + 1; j < len(denoms); j++ {
pairGT = append(pairGT, denoms[i])
pairLT = append(pairLT, denoms[j])
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/utils.go.0" with checksum c87c410e660e59c0a49cccd9df782232 --- ./x/twap/types/utils.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/utils.go.3 2022-10-03 13:43:36.695899625 +0000 @@ -61,7 +61,7 @@
if denom0 == denom1 {
return "", "", fmt.Errorf("both assets cannot be of the same denom: assetA: %s, assetB: %s", denom0, denom1)
}
- if denom0 > denom1 {
+ if denom0 >= denom1 {
denom0, denom1 = denom1, denom0
}
return denom0, denom1, nil
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/utils.go.3" with checksum e7686c5e3558e5bcd3981da87bb85fd3 --- ./x/twap/types/twapmock/amminterface.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.2 2022-10-03 13:44:01.713617740 +0000 @@ -43,7 +43,8 @@
if existingForPool, ok := p.programmedPoolDenoms[poolId]; ok {
poolDenoms = existingForPool.poolDenoms
} else {
- poolDenoms = map[string]struct{}{}
+ _ = poolDenoms
+
}
for _, denom := range overrideDenoms {
poolDenoms[denom] = struct{}{}
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.2" with checksum 4636c91fbffdb853d3085dad3015c1d7 --- ./x/twap/types/twapmock/amminterface.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.3 2022-10-03 13:44:02.713686665 +0000 @@ -46,7 +46,8 @@
poolDenoms = map[string]struct{}{}
}
for _, denom := range overrideDenoms {
- poolDenoms[denom] = struct{}{}
+ _, _ = poolDenoms, denom
+
}
p.programmedPoolDenoms[poolId] = poolDenomsResult{poolDenoms, overrideErr}
}
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.3" with checksum b72bd51ac2564c538681960e115021ca --- ./x/twap/types/twapmock/amminterface.go 2022-10-03 13:17:52.764593378 +0000 +++ /tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.5 2022-10-03 13:44:04.609817346 +0000 @@ -62,7 +62,8 @@
if res, ok := p.programmedPoolDenoms[poolId]; ok {
result := make([]string, 0, len(res.poolDenoms))
for denom := range res.poolDenoms {
- result = append(result, denom)
+ _, _, _ = result, result, denom
+
}
return result, res.err
}
FAIL
"/tmp/go-mutesting-3010144772/./x/twap/types/twapmock/amminterface.go.5" with checksum 7921e28524e767bdb5348fbedf643408 The mutation score is 0.682432 (101 passed, 22 failed, 0 duplicated, 25 skipped, total is 148)