Skip to content

Commit

Permalink
Update create drop to new proto type
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Dusek committed Jun 9, 2024
1 parent 52f40ca commit 4b08af4
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions x/market/keeper/msg_server_create_drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (k msgServer) CreateDrop(goCtx context.Context, msg *types.MsgCreateDrop) (
}

tmp = big.NewInt(0)
tmp.Sqrt(prevDrop.Product.BigInt())
tmp.Sqrt(prevDrop.ProductBeg.BigInt())
sqrtPrevDropProduct := sdk.NewIntFromBigInt(tmp)

// Change in XY should always be positive
Expand Down Expand Up @@ -141,12 +141,14 @@ func (k msgServer) CreateDrop(goCtx context.Context, msg *types.MsgCreateDrop) (
k.SetPool(ctx, pool)

var drop = types.Drop{
Uid: uid,
Owner: msg.Creator,
Pair: pair,
Drops: drops,
Product: dropProduct,
Active: true,
Uid: uid,
Owner: msg.Creator,
Pair: pair,
Drops: drops,
ProductBeg: dropProduct,
Coin1Beg: coin1,
Coin2Beg: coin2,
Active: true,
}

// Add the drop to the keeper
Expand All @@ -163,7 +165,14 @@ func (k msgServer) CreateDrop(goCtx context.Context, msg *types.MsgCreateDrop) (
// Update drop uid count
k.SetUidCount(ctx, uid+1)

return &types.MsgCreateDropResponse{}, nil
return &types.MsgCreateDropResponse{
Creator: msg.Creator,

Check failure on line 169 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Creator in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
Uid: uid,

Check failure on line 170 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Uid in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
Pair: pair,

Check failure on line 171 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Pair in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
Drops: drops.String(),

Check failure on line 172 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Drops in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
Coin1: coin1.String(),

Check failure on line 173 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Coin1 in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
Coin2: coin2.String(),

Check failure on line 174 in x/market/keeper/msg_server_create_drop.go

View workflow job for this annotation

GitHub Actions / Build and Test

unknown field Coin2 in struct literal of type "github.com/pendulum-labs/market/x/market/types".MsgCreateDropResponse
}, nil
}

func (k msgServer) updateLeaders(ctx sdk.Context, pool types.Pool, dropCreator string, dropCreatorSum sdk.Int) types.Pool {
Expand Down

0 comments on commit 4b08af4

Please sign in to comment.