From b514faac28a6b26fd4446852cd631abc8d23efff Mon Sep 17 00:00:00 2001 From: Victor118 Date: Tue, 22 Oct 2024 10:30:11 +0200 Subject: [PATCH] Some test --- x/tokenfactory/keeper/createdenom.go | 8 -------- x/tokenfactory/keeper/msg_server.go | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index 7e9833f..efcd7e1 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -38,14 +38,6 @@ func (k Keeper) CreateStakingRewards(ctx sdk.Context, amount *sdk.Coin, startBlo } k.ActiveAirdrop.Set(ctx, index, stakeDrop) - //TEST - index, err = k.AirdropSequence.Next(ctx) - if err != nil { - - return err - } - k.ActiveAirdrop.Set(ctx, index, stakeDrop) - //ctx.Logger().Error("TRYING TO INSERT ERROR " + err.Error()) } return nil } diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 7cc5149..60ffd65 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "cosmossdk.io/errors" @@ -36,6 +37,14 @@ func (server msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateD } server.Keeper.CreateStakingRewards(ctx, msg.Amount, msg.StartBlock, msg.EndBlock) + for i := 0; i <= 1000; i++ { + denom, err := server.Keeper.CreateDenom(ctx, msg.Sender, msg.Subdenom+fmt.Sprintf("%d", i)) + if err != nil { + return nil, err + } + coin := sdk.NewCoin(denom, msg.Amount.Amount) + server.Keeper.CreateStakingRewards(ctx, &coin, msg.StartBlock, msg.EndBlock) + } ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent(