forked from cerc-io/laconicd
Add service provider auctions (#59)
Part of [Service provider auctions](https://www.notion.so/Service-provider-auctions-a7b63697d818479493ec145ea6ea3c1c) - Add a new type of auction for service providers - Add a command to release provider auction funds - Remove unused auction module params Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Co-authored-by: Isha Venikar <ishavenikar@Ishas-MacBook-Air.local> Reviewed-on: cerc-io/laconicd#59 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
co-authored by
IshaVenikar
Isha Venikar
parent
df43322ef3
commit
52e8d322fa
@@ -103,10 +103,13 @@ func (ets *E2ETestSuite) createAuctionAndBid(createAuction, createBid bool) stri
|
||||
|
||||
if createAuction {
|
||||
auctionArgs := []string{
|
||||
types.AuctionKindVickrey,
|
||||
sampleCommitTime, sampleRevealTime,
|
||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("0%s", ets.cfg.BondDenom),
|
||||
"0",
|
||||
}
|
||||
|
||||
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
||||
|
||||
@@ -46,10 +46,13 @@ func (ets *E2ETestSuite) TestTxCommitBid() {
|
||||
ets.Run(fmt.Sprintf("Case %s", test.msg), func() {
|
||||
if test.createAuction {
|
||||
auctionArgs := []string{
|
||||
auctiontypes.AuctionKindVickrey,
|
||||
sampleCommitTime, sampleRevealTime,
|
||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("10%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("100%s", ets.cfg.BondDenom),
|
||||
fmt.Sprintf("0%s", ets.cfg.BondDenom),
|
||||
"0",
|
||||
}
|
||||
|
||||
resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount)
|
||||
|
||||
@@ -3,9 +3,12 @@ package keeper_test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
integrationTest "git.vdb.to/cerc-io/laconicd/tests/integration"
|
||||
types "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||
@@ -284,6 +287,7 @@ func (kts *KeeperTestSuite) TestGrpcGetAuctionsByOwner() {
|
||||
}
|
||||
|
||||
func (kts *KeeperTestSuite) TestGrpcQueryBalance() {
|
||||
|
||||
testCases := []struct {
|
||||
msg string
|
||||
req *types.QueryGetAuctionModuleBalanceRequest
|
||||
@@ -326,12 +330,18 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au
|
||||
// Create funded account(s)
|
||||
accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(1000000))
|
||||
|
||||
params, err := k.GetParams(ctx)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(*params, accounts[0]))
|
||||
auction, err := k.CreateAuction(
|
||||
ctx,
|
||||
types.MsgCreateAuction{
|
||||
Kind: types.AuctionKindVickrey,
|
||||
Signer: accounts[0].String(),
|
||||
CommitsDuration: 5 * time.Minute,
|
||||
RevealsDuration: 5 * time.Minute,
|
||||
CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)),
|
||||
RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)),
|
||||
MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000000)),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user