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

feat: add test cases for batchAuctino and modifyBid #96

Merged
merged 11 commits into from
Feb 22, 2022
Merged
150 changes: 32 additions & 118 deletions client/docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13446,7 +13446,7 @@ paths:
type: string
format: uint64
title: id specifies an index of a bid for the bidder
bidType:
type:
title: >-
type specifies the bid type; type 1 is fixed price, 2 is
how-much-worth, 3
Expand All @@ -13468,15 +13468,14 @@ paths:
batch auction
- Bid_TYPE_BATCH_MANY: Bid_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch
auction
bidPrice:
price:
type: string
title: >-
bid_price specifies the bid price in which price the
bidder places the bid
bidCoin:
price specifies the bid price in which price the bidder
places the bid
coin:
description: >-
bid_coin specifies the amount of coin that the bidder
bids
coin specifies the amount of coin that the bidder bids

for a fixed price auction, the denom is of the paying
coin.
Expand All @@ -13492,24 +13491,6 @@ paths:
type: string
amount:
type: string
payingCoin:
description: >-
paying_coin specifies the paying amount of coin that the
bidder bids

for a fixed price auction, paying_coin = bid_coin.

for a batch auction of how-much-worth, paying_coin =
bid_coin.

for a batch auction of how-many-coins, paying_coin =
bid_coin x bid_price.
type: object
properties:
denom:
type: string
amount:
type: string
height:
type: string
format: uint64
Expand Down Expand Up @@ -13835,7 +13816,7 @@ paths:
type: string
format: uint64
title: id specifies an index of a bid for the bidder
bidType:
type:
title: >-
type specifies the bid type; type 1 is fixed price, 2 is
how-much-worth, 3
Expand All @@ -13857,14 +13838,14 @@ paths:
batch auction
- Bid_TYPE_BATCH_MANY: Bid_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch
auction
bidPrice:
price:
type: string
title: >-
bid_price specifies the bid price in which price the
bidder places the bid
bidCoin:
price specifies the bid price in which price the bidder
places the bid
coin:
description: >-
bid_coin specifies the amount of coin that the bidder bids
coin specifies the amount of coin that the bidder bids

for a fixed price auction, the denom is of the paying
coin.
Expand All @@ -13880,24 +13861,6 @@ paths:
type: string
amount:
type: string
payingCoin:
description: >-
paying_coin specifies the paying amount of coin that the
bidder bids

for a fixed price auction, paying_coin = bid_coin.

for a batch auction of how-much-worth, paying_coin =
bid_coin.

for a batch auction of how-many-coins, paying_coin =
bid_coin x bid_price.
type: object
properties:
denom:
type: string
amount:
type: string
height:
type: string
format: uint64
Expand Down Expand Up @@ -21979,7 +21942,7 @@ definitions:
type: string
format: uint64
title: id specifies an index of a bid for the bidder
bidType:
type:
title: >-
type specifies the bid type; type 1 is fixed price, 2 is
how-much-worth, 3
Expand All @@ -22001,14 +21964,12 @@ definitions:
batch auction
- Bid_TYPE_BATCH_MANY: Bid_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch
auction
bidPrice:
price:
type: string
title: >-
bid_price specifies the bid price in which price the bidder places the
bid
bidCoin:
title: price specifies the bid price in which price the bidder places the bid
coin:
description: >-
bid_coin specifies the amount of coin that the bidder bids
coin specifies the amount of coin that the bidder bids

for a fixed price auction, the denom is of the paying coin.

Expand All @@ -22023,22 +21984,6 @@ definitions:
type: string
amount:
type: string
payingCoin:
description: >-
paying_coin specifies the paying amount of coin that the bidder bids

for a fixed price auction, paying_coin = bid_coin.

for a batch auction of how-much-worth, paying_coin = bid_coin.

for a batch auction of how-many-coins, paying_coin = bid_coin x
bid_price.
type: object
properties:
denom:
type: string
amount:
type: string
height:
type: string
format: uint64
Expand Down Expand Up @@ -22085,6 +22030,9 @@ definitions:
description: |-
MsgCreateFixedPriceAuctionResponse defines the
Msg/MsgCreateFixedPriceAuctionResponse response type.
tendermint.fundraising.MsgModifyBidResponse:
type: object
description: MsgModifyBidResponse defines the Msg/MsgModifyBidResponse response type.
tendermint.fundraising.MsgPlaceBidResponse:
type: object
description: MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type.
Expand Down Expand Up @@ -22501,7 +22449,7 @@ definitions:
type: string
format: uint64
title: id specifies an index of a bid for the bidder
bidType:
type:
title: >-
type specifies the bid type; type 1 is fixed price, 2 is
how-much-worth, 3
Expand All @@ -22523,14 +22471,14 @@ definitions:
batch auction
- Bid_TYPE_BATCH_MANY: Bid_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch
auction
bidPrice:
price:
type: string
title: >-
bid_price specifies the bid price in which price the bidder places
the bid
bidCoin:
price specifies the bid price in which price the bidder places the
bid
coin:
description: >-
bid_coin specifies the amount of coin that the bidder bids
coin specifies the amount of coin that the bidder bids

for a fixed price auction, the denom is of the paying coin.

Expand All @@ -22545,23 +22493,6 @@ definitions:
type: string
amount:
type: string
payingCoin:
description: >-
paying_coin specifies the paying amount of coin that the bidder
bids

for a fixed price auction, paying_coin = bid_coin.

for a batch auction of how-much-worth, paying_coin = bid_coin.

for a batch auction of how-many-coins, paying_coin = bid_coin x
bid_price.
type: object
properties:
denom:
type: string
amount:
type: string
height:
type: string
format: uint64
Expand Down Expand Up @@ -22597,7 +22528,7 @@ definitions:
type: string
format: uint64
title: id specifies an index of a bid for the bidder
bidType:
type:
title: >-
type specifies the bid type; type 1 is fixed price, 2 is
how-much-worth, 3
Expand All @@ -22619,14 +22550,14 @@ definitions:
batch auction
- Bid_TYPE_BATCH_MANY: Bid_TYPE_BATCH_MANY defines a bid type for How-Many-Coins-to-Buy of a batch
auction
bidPrice:
price:
type: string
title: >-
bid_price specifies the bid price in which price the bidder
places the bid
bidCoin:
price specifies the bid price in which price the bidder places
the bid
coin:
description: >-
bid_coin specifies the amount of coin that the bidder bids
coin specifies the amount of coin that the bidder bids

for a fixed price auction, the denom is of the paying coin.

Expand All @@ -22641,23 +22572,6 @@ definitions:
type: string
amount:
type: string
payingCoin:
description: >-
paying_coin specifies the paying amount of coin that the bidder
bids

for a fixed price auction, paying_coin = bid_coin.

for a batch auction of how-much-worth, paying_coin = bid_coin.

for a batch auction of how-many-coins, paying_coin = bid_coin x
bid_price.
type: object
properties:
denom:
type: string
amount:
type: string
height:
type: string
format: uint64
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/google/go-cmp v0.5.7 // indirect
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 // indirect
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.4.1
github.com/spf13/cobra v1.2.1
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
Expand Down Expand Up @@ -611,6 +612,8 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -764,6 +767,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC
github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
Expand Down Expand Up @@ -1647,6 +1652,7 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -2103,4 +2109,6 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
23 changes: 7 additions & 16 deletions proto/fundraising/fundraising.proto
Original file line number Diff line number Diff line change
Expand Up @@ -246,38 +246,29 @@ message Bid {

// type specifies the bid type; type 1 is fixed price, 2 is how-much-worth, 3
// is how-many-coins
BidType bid_type = 4;
BidType type = 4;

// bid_price specifies the bid price in which price the bidder places the bid
string bid_price = 5 [
// price specifies the bid price in which price the bidder places the bid
string price = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];

// bid_coin specifies the amount of coin that the bidder bids
// coin specifies the amount of coin that the bidder bids
// for a fixed price auction, the denom is of the paying coin.
// for a batch auction of how-much-worth, the denom is of the paying coin.
// for a batch auction of how-many-coins, the denom is of the selling coin.
cosmos.base.v1beta1.Coin bid_coin = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
];

// paying_coin specifies the paying amount of coin that the bidder bids
// for a fixed price auction, paying_coin = bid_coin.
// for a batch auction of how-much-worth, paying_coin = bid_coin.
// for a batch auction of how-many-coins, paying_coin = bid_coin x bid_price.
cosmos.base.v1beta1.Coin paying_coin = 7 [
cosmos.base.v1beta1.Coin coin = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
];

// height specifies the block height of the bid
uint64 height = 8;
uint64 height = 7;

// isWinner specifies the bid that is a winning bid and enables the bidder to
// purchase the selling coin
bool isWinner = 9;
bool isWinner = 8;
}

// BidType enumerates the valid types of a bid.
Expand Down
Loading