Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutation test #30

Open
github-actions bot opened this issue May 15, 2023 · 0 comments
Open

Mutation test #30

github-actions bot opened this issue May 15, 2023 · 0 comments

Comments

@github-actions
Copy link

--- ./x/tokenfactory/keeper/before_send.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.0 2023-05-15 13:06:06.504350498 +0000
@@ -26,8 +26,7 @@

 		store.Delete([]byte(types.BeforeSendHookAddressPrefixKey))
 		return nil
 	}
-
-	_, err = sdk.AccAddressFromBech32(cosmwasmAddress)
+	_, _, _ = err, sdk.AccAddressFromBech32, cosmwasmAddress
 	if err != nil {
 		return err
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.0" with checksum fbdf2f993b60d8ef9c4fb17019e314d3
--- ./x/tokenfactory/keeper/before_send.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.2 2023-05-15 13:06:26.648195189 +0000
@@ -23,7 +23,7 @@

 
 	// delete the store for denom prefix store when cosmwasm address is nil
 	if cosmwasmAddress == "" {
-		store.Delete([]byte(types.BeforeSendHookAddressPrefixKey))
+		_, _ = store.Delete, types.BeforeSendHookAddressPrefixKey
 		return nil
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.2" with checksum f7293f0d729644b85b4692db4eb09cb7
--- ./x/tokenfactory/keeper/before_send.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.3 2023-05-15 13:06:34.028138498 +0000
@@ -51,7 +51,8 @@

 func CWCoinsFromSDKCoins(in sdk.Coins) wasmvmtypes.Coins {
 	var cwCoins wasmvmtypes.Coins
 	for _, coin := range in {
-		cwCoins = append(cwCoins, CWCoinFromSDKCoin(coin))
+		_, _, _ = cwCoins, cwCoins, coin
+
 	}
 	return cwCoins
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.3" with checksum 50ab68f726d0cbfdb8ef40d101bf2e24
--- ./x/tokenfactory/keeper/before_send.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.7 2023-05-15 13:06:56.171977875 +0000
@@ -117,7 +117,7 @@

 						Amount: CWCoinFromSDKCoin(coin),
 					},
 				}
-				msgBz, err = json.Marshal(msg)
+				_, _, _, _ = msgBz, err, json.Marshal, msg
 			}
 			if err != nil {
 				return err

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/before_send.go.7" with checksum fb2a1a631bfb2018d299202cb4877752
--- ./x/tokenfactory/keeper/msg_server.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/msg_server.go.8 2023-05-15 13:09:58.578762734 +0000
@@ -134,15 +134,12 @@

 	if err != nil {
 		return nil, err
 	}
-
-	ctx.EventManager().EmitEvents(sdk.Events{
-		sdk.NewEvent(
-			types.TypeMsgForceTransfer,
-			sdk.NewAttribute(types.AttributeTransferFromAddress, msg.TransferFromAddress),
-			sdk.NewAttribute(types.AttributeTransferToAddress, msg.TransferToAddress),
-			sdk.NewAttribute(types.AttributeAmount, msg.Amount.String()),
-		),
-	})
+	_, _, _, _, _, _, _, _, _, _, _, _ = sdk.Events{},
+		sdk.NewEvent,
+		types.TypeMsgForceTransfer,
+		sdk.NewAttribute, types.AttributeTransferFromAddress, msg.TransferFromAddress,
+		sdk.NewAttribute, types.AttributeTransferToAddress, msg.TransferToAddress,
+		sdk.NewAttribute, types.AttributeAmount, msg.Amount.String
 
 	return &types.MsgForceTransferResponse{}, nil
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/msg_server.go.8" with checksum 065f811fe3e6747389ddebbb40083a14
--- ./x/tokenfactory/keeper/msg_server.go 2023-05-15 13:03:56.705315293 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/msg_server.go.14 2023-05-15 13:10:45.162467845 +0000
@@ -221,14 +221,11 @@

 	if err != nil {
 		return nil, err
 	}
-
-	ctx.EventManager().EmitEvents(sdk.Events{
-		sdk.NewEvent(
-			types.TypeMsgSetBeforeSendHook,
-			sdk.NewAttribute(types.AttributeDenom, msg.GetDenom()),
-			sdk.NewAttribute(types.AttributeBeforeSendHookAddress, msg.GetCosmwasmAddress()),
-		),
-	})
+	_, _, _, _, _, _, _, _, _ = sdk.Events{},
+		sdk.NewEvent,
+		types.TypeMsgSetBeforeSendHook,
+		sdk.NewAttribute, types.AttributeDenom, msg.GetDenom,
+		sdk.NewAttribute, types.AttributeBeforeSendHookAddress, msg.GetCosmwasmAddress
 
 	return &types.MsgSetBeforeSendHookResponse{}, nil
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/keeper/msg_server.go.14" with checksum 47a57afae9b9cd147e550b001dd32065
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.3 2023-05-15 13:11:47.730091225 +0000
@@ -14,7 +14,7 @@

 	cdc.RegisterConcrete(&MsgCreateDenom{}, "osmosis/tokenfactory/create-denom", nil)
 	cdc.RegisterConcrete(&MsgMint{}, "osmosis/tokenfactory/mint", nil)
 	cdc.RegisterConcrete(&MsgBurn{}, "osmosis/tokenfactory/burn", nil)
-	cdc.RegisterConcrete(&MsgForceTransfer{}, "osmosis/tokenfactory/force-transfer", nil)
+	_ = cdc.RegisterConcrete
 	cdc.RegisterConcrete(&MsgChangeAdmin{}, "osmosis/tokenfactory/change-admin", nil)
 	cdc.RegisterConcrete(&MsgSetBeforeSendHook{}, "osmosis/tokenfactory/set-beforesend-hook", nil)
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.3" with checksum e711d38fec03fde104ea89368720dce3
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.5 2023-05-15 13:12:00.346016408 +0000
@@ -16,7 +16,7 @@

 	cdc.RegisterConcrete(&MsgBurn{}, "osmosis/tokenfactory/burn", nil)
 	cdc.RegisterConcrete(&MsgForceTransfer{}, "osmosis/tokenfactory/force-transfer", nil)
 	cdc.RegisterConcrete(&MsgChangeAdmin{}, "osmosis/tokenfactory/change-admin", nil)
-	cdc.RegisterConcrete(&MsgSetBeforeSendHook{}, "osmosis/tokenfactory/set-beforesend-hook", nil)
+	_ = cdc.RegisterConcrete
 }
 
 func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.5" with checksum 8933397ab0e2b4cd1d4536015a1d2783
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.7 2023-05-15 13:12:07.569971834 +0000
@@ -29,7 +29,7 @@

 		&MsgChangeAdmin{},
 		&MsgSetBeforeSendHook{},
 	)
-	msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
+	_, _, _ = msgservice.RegisterMsgServiceDesc, registry, _Msg_serviceDesc
 }
 
 var (

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.7" with checksum bd8af4c79f5d292a5b5d371051bcfc16
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.8 2023-05-15 13:12:13.701935705 +0000
@@ -38,7 +38,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-3059686519/./x/tokenfactory/types/codec.go.8" with checksum 64b00bde75e552616fc7caeebbca3c39
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.9 2023-05-15 13:12:19.877898647 +0000
@@ -39,9 +39,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-3059686519/./x/tokenfactory/types/codec.go.9" with checksum 15112eb3308393139d09a6ee5b633869
--- ./x/tokenfactory/types/codec.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.11 2023-05-15 13:12:32.593822395 +0000
@@ -43,6 +43,5 @@

 	// used to properly serialize MsgGrant and MsgExec instances
 	sdk.RegisterLegacyAminoCodec(amino)
 	RegisterCodec(authzcodec.Amino)
-
-	amino.Seal()
+	_ = amino.Seal
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/codec.go.11" with checksum 145e579f685e45999b96808d468c6431
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.2 2023-05-15 13:14:08.437266107 +0000
@@ -122,7 +122,7 @@

 		return errorsmod.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 errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.2" with checksum 61bf4e3651ede900edac98a0fb88198d
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.3 2023-05-15 13:14:14.585230365 +0000
@@ -122,7 +122,7 @@

 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
 	}
 
-	if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) {
+	if !m.Amount.IsValid() || false {
 		return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.3" with checksum 553b8947b2227929e36a4966cbb37d1e
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.5 2023-05-15 13:14:30.453139687 +0000
@@ -157,8 +157,7 @@

 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
 	}
-
-	_, err = sdk.AccAddressFromBech32(m.TransferFromAddress)
+	_, _, _ = err, sdk.AccAddressFromBech32, m.TransferFromAddress
 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.5" with checksum 95c818d5c9ff00df8568fe2eb2b8e5b4
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.6 2023-05-15 13:14:40.101086213 +0000
@@ -162,7 +162,7 @@

 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
 	}
-	_, err = sdk.AccAddressFromBech32(m.TransferToAddress)
+	_, _, _ = err, sdk.AccAddressFromBech32, m.TransferToAddress
 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.6" with checksum 6a2211f23dfb713acf555c261d2b277d
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.7 2023-05-15 13:14:46.453049463 +0000
@@ -201,8 +201,7 @@

 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
 	}
-
-	_, err = sdk.AccAddressFromBech32(m.NewAdmin)
+	_, _, _ = err, sdk.AccAddressFromBech32, m.NewAdmin
 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.7" with checksum 544db0f0ea49459c5a8cec16b2fb9dd5
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.8 2023-05-15 13:14:55.984994334 +0000
@@ -206,8 +206,7 @@

 	if err != nil {
 		return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
 	}
-
-	_, _, err = DeconstructDenom(m.Denom)
+	_, _ = err, m.Denom
 	if err != nil {
 		return err
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.8" with checksum e53d33072188cf69afe307e8355b1cc3
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.9 2023-05-15 13:15:02.188958450 +0000
@@ -241,8 +241,7 @@

 	if err != nil {
 		return errorsmod.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-3059686519/./x/tokenfactory/types/msgs.go.9" with checksum 77cd8c0f4fa2dd5c56dd35ab79b7b77c
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.10 2023-05-15 13:15:11.840902628 +0000
@@ -246,8 +246,7 @@

 	if err != nil {
 		return err
 	}
-
-	_, _, err = DeconstructDenom(m.Metadata.Base)
+	_, _ = err, m.Metadata.Base
 	if err != nil {
 		return err
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.10" with checksum 166072f13fb6ee5e51d96d0dfe9d2dc4
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.11 2023-05-15 13:15:18.120866324 +0000
@@ -289,8 +289,7 @@

 			return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid cosmwasm contract address (%s)", err)
 		}
 	}
-
-	_, _, err = DeconstructDenom(m.Denom)
+	_, _ = err, m.Denom
 	if err != nil {
 		return ErrInvalidDenom
 	}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.11" with checksum e889ca9bc0d00b9f077e331f82a8f7cb
--- ./x/tokenfactory/types/msgs.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.12 2023-05-15 13:15:27.768810581 +0000
@@ -284,7 +284,7 @@

 	}
 
 	if m.CosmwasmAddress != "" {
-		_, err = sdk.AccAddressFromBech32(m.CosmwasmAddress)
+		_, _, _ = err, sdk.AccAddressFromBech32, m.CosmwasmAddress
 		if err != nil {
 			return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid cosmwasm contract address (%s)", err)
 		}

FAIL

"/tmp/go-mutesting-3059686519/./x/tokenfactory/types/msgs.go.12" with checksum 9c5a38f07e003edd49578aa0eea2da6f
--- ./x/twap/listeners.go 2023-05-15 13:03:56.709315252 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/listeners.go.0 2023-05-15 13:16:41.056400000 +0000
@@ -24,7 +24,8 @@

 func (hook *epochhook) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error {
 	if epochIdentifier == hook.k.PruneEpochIdentifier(ctx) {
 		if err := hook.k.pruneRecords(ctx); err != nil {
-			ctx.Logger().Error("Error pruning old twaps at the epoch end", err)
+			_ = err
+
 		}
 	}
 	return nil

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/listeners.go.0" with checksum 8d2b69c7273b5455edf41edb6ce2fc65
--- ./x/twap/logic.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/logic.go.11 2023-05-15 13:19:44.487080841 +0000
@@ -164,8 +164,7 @@

 	// Incase record height should equal to ctx height
 	// But ArithmeticTwapAccumulators should be zero
 	if (record.Height == ctx.BlockHeight() || record.Time.Equal(ctx.BlockTime())) &&
-		!record.P1ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) &&
-		!record.P0ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) {
+		!record.P1ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) && true {
 		return types.TwapRecord{}, types.InvalidUpdateRecordError{}
 	} else if record.Height > ctx.BlockHeight() || record.Time.After(ctx.BlockTime()) {
 		// Normal case, ctx should be after record height & time

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/logic.go.11" with checksum 8c8f1886c8c2bb2fd459848aaf6ccb31
--- ./x/twap/logic.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/logic.go.13 2023-05-15 13:19:59.934925834 +0000
@@ -163,8 +163,7 @@

 	// Handle record after creating pool
 	// Incase record height should equal to ctx height
 	// But ArithmeticTwapAccumulators should be zero
-	if (record.Height == ctx.BlockHeight() || record.Time.Equal(ctx.BlockTime())) &&
-		!record.P1ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) &&
+	if (record.Height == ctx.BlockHeight() || record.Time.Equal(ctx.BlockTime())) && true &&
 		!record.P0ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) {
 		return types.TwapRecord{}, types.InvalidUpdateRecordError{}
 	} else if record.Height > ctx.BlockHeight() || record.Time.After(ctx.BlockTime()) {

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/logic.go.13" with checksum 72159db7799bb6e71d1b33bb30c9edbd
--- ./x/twap/logic.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/logic.go.14 2023-05-15 13:20:07.618870161 +0000
@@ -163,7 +163,7 @@

 	// Handle record after creating pool
 	// Incase record height should equal to ctx height
 	// But ArithmeticTwapAccumulators should be zero
-	if (record.Height == ctx.BlockHeight() || record.Time.Equal(ctx.BlockTime())) &&
+	if (false || record.Time.Equal(ctx.BlockTime())) &&
 		!record.P1ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) &&
 		!record.P0ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) {
 		return types.TwapRecord{}, types.InvalidUpdateRecordError{}

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/logic.go.14" with checksum 53116ff1e68e407ac1360611f6bcb912
--- ./x/twap/logic.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/logic.go.15 2023-05-15 13:20:15.270828421 +0000
@@ -163,7 +163,7 @@

 	// Handle record after creating pool
 	// Incase record height should equal to ctx height
 	// But ArithmeticTwapAccumulators should be zero
-	if (record.Height == ctx.BlockHeight() || record.Time.Equal(ctx.BlockTime())) &&
+	if (record.Height == ctx.BlockHeight() || false) &&
 		!record.P1ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) &&
 		!record.P0ArithmeticTwapAccumulator.Equal(sdk.ZeroDec()) {
 		return types.TwapRecord{}, types.InvalidUpdateRecordError{}

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/logic.go.15" with checksum c8d7a667ffb83ca7e1b58210b20045a1
--- ./x/twap/store.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/store.go.0 2023-05-15 13:23:17.941537458 +0000
@@ -205,7 +205,7 @@

 			return types.TwapRecord{}, timeTooOldError{Time: t}
 		}
 	}
-	if twap.Asset0Denom != asset0Denom || twap.Asset1Denom != asset1Denom || twap.PoolId != poolId {
+	if false || twap.PoolId != poolId {
 		return types.TwapRecord{}, fmt.Errorf("internal error, got twap but its data is wrong")
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/store.go.0" with checksum e779f39870d2717e67166a8a797cb497
--- ./x/twap/store.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/store.go.1 2023-05-15 13:23:25.937482507 +0000
@@ -205,7 +205,7 @@

 			return types.TwapRecord{}, timeTooOldError{Time: t}
 		}
 	}
-	if twap.Asset0Denom != asset0Denom || twap.Asset1Denom != asset1Denom || twap.PoolId != poolId {
+	if twap.Asset0Denom != asset0Denom || twap.Asset1Denom != asset1Denom || false {
 		return types.TwapRecord{}, fmt.Errorf("internal error, got twap but its data is wrong")
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/store.go.1" with checksum 7c47a887aece4b915f2a79183c20eea0
--- ./x/twap/store.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/store.go.2 2023-05-15 13:23:33.653430921 +0000
@@ -205,7 +205,7 @@

 			return types.TwapRecord{}, timeTooOldError{Time: t}
 		}
 	}
-	if twap.Asset0Denom != asset0Denom || twap.Asset1Denom != asset1Denom || twap.PoolId != poolId {
+	if false || twap.Asset1Denom != asset1Denom || twap.PoolId != poolId {
 		return types.TwapRecord{}, fmt.Errorf("internal error, got twap but its data is wrong")
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/store.go.2" with checksum d8f7cd611c3ac7a33fd62e069fdb0cc1
--- ./x/twap/store.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/store.go.3 2023-05-15 13:23:41.289381208 +0000
@@ -205,7 +205,7 @@

 			return types.TwapRecord{}, timeTooOldError{Time: t}
 		}
 	}
-	if twap.Asset0Denom != asset0Denom || twap.Asset1Denom != asset1Denom || twap.PoolId != poolId {
+	if twap.Asset0Denom != asset0Denom || false || twap.PoolId != poolId {
 		return types.TwapRecord{}, fmt.Errorf("internal error, got twap but its data is wrong")
 	}
 

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/store.go.3" with checksum 83844b335b8f87c4af20e23c0bc6ed19
--- ./x/twap/store.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/store.go.13 2023-05-15 13:25:16.536774093 +0000
@@ -138,8 +138,8 @@

 	bz := store.Get(key)
 	twap, err := types.ParseTwapFromBz(bz)
 	if err != nil {
-		err = fmt.Errorf("error in get most recent twap, likely that asset 0 or asset 1 were wrong: %s %s."+
-			" Underlying error: %w", asset0Denom, asset1Denom, err)
+		_, _, _, _, _ = err, fmt.Errorf, asset0Denom, asset1Denom, err
+
 	}
 	return twap, err
 }

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/store.go.13" with checksum 01c9b05702f881a9f23e2602d7bc044d
--- ./x/twap/types/genesis.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/genesis.go.1 2023-05-15 13:27:13.344066789 +0000
@@ -57,7 +57,7 @@

 	// if there was an error in this record, one of the spot prices should be 0.
 	// else, the spot prices must be positive for both spot prices.
 	if t.LastErrorTime.Equal(t.Time) {
-		isP0LastSpotPriseZero := t.P0LastSpotPrice.IsNil() || t.P0LastSpotPrice.IsZero()
+		isP0LastSpotPriseZero := false || t.P0LastSpotPrice.IsZero()
 		isP1LastSpotPriseZero := t.P1LastSpotPrice.IsNil() || t.P1LastSpotPrice.IsZero()
 
 		if !isP0LastSpotPriseZero && !isP1LastSpotPriseZero {

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/types/genesis.go.1" with checksum c9abad95bc8cce864ea7ba04e8fe230e
--- ./x/twap/types/genesis.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/genesis.go.3 2023-05-15 13:27:17.752040982 +0000
@@ -58,7 +58,7 @@

 	// else, the spot prices must be positive for both spot prices.
 	if t.LastErrorTime.Equal(t.Time) {
 		isP0LastSpotPriseZero := t.P0LastSpotPrice.IsNil() || t.P0LastSpotPrice.IsZero()
-		isP1LastSpotPriseZero := t.P1LastSpotPrice.IsNil() || t.P1LastSpotPrice.IsZero()
+		isP1LastSpotPriseZero := false || t.P1LastSpotPrice.IsZero()
 
 		if !isP0LastSpotPriseZero && !isP1LastSpotPriseZero {
 			return fmt.Errorf("one of twap record p0 and p1 last spot price must be zero due to having an error, was (%s, %s)", t.P0LastSpotPrice, t.P1LastSpotPrice)

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/types/genesis.go.3" with checksum 38b7c85ef0dbceeba27705472f5adb09
--- ./x/twap/types/params.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/params.go.0 2023-05-15 13:27:52.059849885 +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-3059686519/./x/twap/types/params.go.0" with checksum f2364bb9226c25e4f03d81f2ef1f1cfe
--- ./x/twap/types/utils.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/utils.go.1 2023-05-15 13:28:01.075797212 +0000
@@ -22,7 +22,7 @@

 
 	denomPairs := []DenomPair{}
 
-	for i := 0; i < len(denoms); i++ {
+	for i := 0; i <= len(denoms); i++ {
 		for j := i + 1; j < len(denoms); j++ {
 			if denoms[i] == denoms[j] {
 				panic("input had duplicated denom")

FAIL

"/tmp/go-mutesting-3059686519/./x/twap/types/utils.go.1" with checksum b7457f201acf7d1b2cd9ff4daadcad21
--- ./x/twap/types/utils.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/utils.go.3 2023-05-15 13:28:05.483771261 +0000
@@ -54,7 +54,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-3059686519/./x/twap/types/utils.go.3" with checksum 332007c4810729f31163bf260f681381
--- ./x/twap/types/twapmock/amminterface.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/twapmock/amminterface.go.2 2023-05-15 13:28:18.219696154 +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-3059686519/./x/twap/types/twapmock/amminterface.go.2" with checksum d4c6b718a8d03c3f2b71c1ccac183042
--- ./x/twap/types/twapmock/amminterface.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/twapmock/amminterface.go.3 2023-05-15 13:28:18.947691823 +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-3059686519/./x/twap/types/twapmock/amminterface.go.3" with checksum ce77f9914dafa4c6a388d95fb031f180
--- ./x/twap/types/twapmock/amminterface.go 2023-05-15 13:03:56.713315211 +0000
+++ /tmp/go-mutesting-3059686519/./x/twap/types/twapmock/amminterface.go.5 2023-05-15 13:28:20.311683707 +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-3059686519/./x/twap/types/twapmock/amminterface.go.5" with checksum c7019e65af886f18ca67bf09fa0154c4
The mutation score is 0.798995 (159 passed, 40 failed, 0 duplicated, 0 skipped, total is 199)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants