Skip to content

Commit

Permalink
feat: add testing cli that enables MsgAddAllowedBidder (#83)
Browse files Browse the repository at this point in the history
* chore: add proto tx message for MsgAddAllowedBidder and cli command

* docs: adding add allowed bidder message

* env: update config.yml

* revert: revert not to use pointer

* env: add config-test.yml that enables add allowed bidder

* docs: add allowed bidder example

* docs: tidy up comments

* docs: update How-To cli README.md

* docs: rename EnglishAuction to BatchAuction

* revert: previous commit
  • Loading branch information
jaybxyz authored Feb 21, 2022
1 parent ec69704 commit b308a22
Show file tree
Hide file tree
Showing 27 changed files with 1,012 additions and 262 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ proto-format:
###############################################################################

localnet:
starport chain serve -v
starport chain serve -v -c ./config-test.yml

.PHONY: localnet
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Cosmos SDK | v0.44.0
git clone https://github.com/tendermint/fundraising.git
cd fundraising
make install

# Install binary in testing mode enables MsgAddAllowedBidder to add an allowed bidder
make install-testing
```

## Getting started
Expand Down
14 changes: 14 additions & 0 deletions client/docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21874,6 +21874,18 @@ definitions:
and

freezing clients
tendermint.fundraising.AllowedBidder:
type: object
properties:
bidder:
type: string
title: bidder specifies the bech32-encoded address that bids for the auction
maxBidAmount:
type: string
title: >-
max_bid_amount specifies the maximum bid amount that the bidder can
bid
description: AllowedBidder defines an allowed bidder for the auction.
tendermint.fundraising.Bid:
type: object
properties:
Expand Down Expand Up @@ -21918,6 +21930,8 @@ definitions:
eligible specifies the bid that is eligible to purchase the selling
coin
description: Bid defines a standard bid for an auction.
tendermint.fundraising.MsgAddAllowedBidderResponse:
type: object
tendermint.fundraising.MsgCancelAuctionResponse:
type: object
description: |-
Expand Down
19 changes: 19 additions & 0 deletions config-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
accounts:
- name: alice
coins: ["2000000000000stake","1000000000000000denom1","1000000000000000denom2"]
- name: bob
coins: ["2000000000000stake","1000000000000000denom1"]
- name: steve
coins: ["1000000000000000denom2"]
validator:
name: alice
staked: "1000000000000stake"
client:
openapi:
path: "client/docs/static/openapi.yml"
faucet:
name: alice
coins: ["100000stake", "1000000denom1", "1000000denom2"]
build:
binary: "fundraisingd"
ldflags: ["-X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=true"]
7 changes: 5 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
accounts:
- name: alice
coins: ["2000000000000stake","1000000000000000denom1","1000000000000000denom2"]
- name: bob # auctioneer
- name: bob
coins: ["2000000000000stake","1000000000000000denom1"]
- name: steve # bidder
- name: steve
coins: ["1000000000000000denom2"]
validator:
name: alice
Expand All @@ -14,3 +14,6 @@ client:
faucet:
name: alice
coins: ["100000stake", "1000000denom1", "1000000denom2"]
build:
binary: "fundraisingd"
ldflags: ["-X github.com/tendermint/fundraising/x/fundraising/keeper.enableAddAllowedBidder=false"]
54 changes: 33 additions & 21 deletions docs/How-To/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,40 @@ Result:
"base_auction": {
"id": "1",
"type": "AUCTION_TYPE_FIXED_PRICE",
"auctioneer": "cosmos1k64etk30a60sv9hqla4qctwur65acq9zjdd8jt",
"selling_reserve_address": "cosmos18xzvtd72y9j8xyf8a36z5jjhth7qgtcwhh8lz7yee3tvxqn6ll5quh78zq",
"paying_reserve_address": "cosmos18permjyqvk5flft8ey9egr7hd4ry8tauqt4f9mg9knn4vvtkry9sujucrl",
"allowed_bidders": [
{
"bidder": "cosmos1tfzynkllgxdpmrcknx2j5d0hj9zd82tceyfa5n",
"max_bid_amount": "1000000000"
}
],
"auctioneer": "cosmos1dncsflcfknkmlmt3t6836tkd3mu742e2wh4r70",
"selling_reserve_address": "cosmos1wl90665mfk3pgg095qhmlgha934exjvv437acgq42zw0sg94flestth4zu",
"paying_reserve_address": "cosmos17gk7a5ys8pxuexl7tvyk3pc9tdmqjjek03zjemez4eqvqdxlu92qdhphm2",
"start_price": "1.000000000000000000",
"selling_coin": {
"denom": "denom1",
"amount": "10000000000"
"amount": "1000000000000"
},
"paying_coin_denom": "denom2",
"vesting_reserve_address": "cosmos1gukaqt783nhz79uhcqklsty7lc7jfyy8scn5ke4x7v0m3rkpt4dst7y4l3",
"vesting_reserve_address": "cosmos1q4x4k4qsr4jwrrugnplhlj52mfd9f8jn5ck7r4ykdpv9wczvz4dqe8vrvt",
"vesting_schedules": [
{
"release_time": "2022-01-01T00:00:00Z",
"release_time": "2022-06-21T00:00:00Z",
"weight": "0.500000000000000000"
},
{
"release_time": "2022-12-01T00:00:00Z",
"release_time": "2022-12-21T00:00:00Z",
"weight": "0.500000000000000000"
}
],
"winning_price": "0.000000000000000000",
"remaining_coin": {
"denom": "denom1",
"amount": "9995000000"
"amount": "999995000000"
},
"start_time": "2021-12-01T00:00:00Z",
"start_time": "2022-02-01T00:00:00Z",
"end_times": [
"2021-12-30T00:00:00Z"
"2022-03-01T00:00:00Z"
],
"status": "AUCTION_STATUS_STARTED"
}
Expand Down Expand Up @@ -132,34 +138,40 @@ Result:
"base_auction": {
"id": "1",
"type": "AUCTION_TYPE_FIXED_PRICE",
"auctioneer": "cosmos1k64etk30a60sv9hqla4qctwur65acq9zjdd8jt",
"selling_reserve_address": "cosmos18xzvtd72y9j8xyf8a36z5jjhth7qgtcwhh8lz7yee3tvxqn6ll5quh78zq",
"paying_reserve_address": "cosmos18permjyqvk5flft8ey9egr7hd4ry8tauqt4f9mg9knn4vvtkry9sujucrl",
"allowed_bidders": [
{
"bidder": "cosmos1tfzynkllgxdpmrcknx2j5d0hj9zd82tceyfa5n",
"max_bid_amount": "1000000000"
}
],
"auctioneer": "cosmos1dncsflcfknkmlmt3t6836tkd3mu742e2wh4r70",
"selling_reserve_address": "cosmos1wl90665mfk3pgg095qhmlgha934exjvv437acgq42zw0sg94flestth4zu",
"paying_reserve_address": "cosmos17gk7a5ys8pxuexl7tvyk3pc9tdmqjjek03zjemez4eqvqdxlu92qdhphm2",
"start_price": "1.000000000000000000",
"selling_coin": {
"denom": "denom1",
"amount": "10000000000"
"amount": "1000000000000"
},
"paying_coin_denom": "denom2",
"vesting_reserve_address": "cosmos1gukaqt783nhz79uhcqklsty7lc7jfyy8scn5ke4x7v0m3rkpt4dst7y4l3",
"vesting_reserve_address": "cosmos1q4x4k4qsr4jwrrugnplhlj52mfd9f8jn5ck7r4ykdpv9wczvz4dqe8vrvt",
"vesting_schedules": [
{
"release_time": "2022-01-01T00:00:00Z",
"release_time": "2022-06-21T00:00:00Z",
"weight": "0.500000000000000000"
},
{
"release_time": "2022-12-01T00:00:00Z",
"release_time": "2022-12-21T00:00:00Z",
"weight": "0.500000000000000000"
}
],
"winning_price": "0.000000000000000000",
"remaining_coin": {
"denom": "denom1",
"amount": "9995000000"
"amount": "999995000000"
},
"start_time": "2021-12-01T00:00:00Z",
"start_time": "2022-02-01T00:00:00Z",
"end_times": [
"2021-12-30T00:00:00Z"
"2022-03-01T00:00:00Z"
],
"status": "AUCTION_STATUS_STARTED"
}
Expand All @@ -180,7 +192,7 @@ http://localhost:1317/cosmos/fundraising/v1beta1/auctions/1/bids
| **Query String** | **Description** | **Example** |
| :---------------- | :----------------- | :---------- |
| bidder | The bidder address | {endpoint}/cosmos/fundraising/v1beta1/auctions/1/bids?bidder=cosmos1mc60p3ul372mepchm9shd9r456kur958t4v8ld |
| eligible | The eligible | {endpoint}/cosmos/fundraising/v1beta1/auctions/1/bids?eligible=false |
| eligible | The eligible | {endpoint}/cosmos/fundraising/v1beta1/auctions/1/bids?eligible=false |
| | |

Result:
Expand Down
Loading

0 comments on commit b308a22

Please sign in to comment.