From b308a22197eeef0948d94c23a2e4e6399142283a Mon Sep 17 00:00:00 2001 From: JayB Date: Mon, 21 Feb 2022 16:53:52 +0900 Subject: [PATCH] feat: add testing cli that enables `MsgAddAllowedBidder` (#83) * 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 --- Makefile | 2 +- README.md | 3 + client/docs/static/openapi.yml | 14 + config-test.yml | 19 + config.yml | 7 +- docs/How-To/api/README.md | 54 +-- docs/How-To/cli/README.md | 157 ++++++-- proto/fundraising/fundraising.proto | 2 +- proto/fundraising/tx.proto | 31 +- x/fundraising/client/cli/tx.go | 53 ++- x/fundraising/handler.go | 4 + x/fundraising/keeper/auction.go | 6 +- x/fundraising/keeper/auction_test.go | 55 +-- x/fundraising/keeper/bid_test.go | 2 +- x/fundraising/keeper/keeper.go | 18 + x/fundraising/keeper/keeper_test.go | 2 +- x/fundraising/keeper/msg_server.go | 17 + x/fundraising/keeper/msg_server_test.go | 64 +++- x/fundraising/module_test.go | 2 +- x/fundraising/spec/04_messages.md | 18 + x/fundraising/types/auction.go | 12 +- x/fundraising/types/codec.go | 1 + x/fundraising/types/fundraising.pb.go | 182 ++++----- x/fundraising/types/genesis_test.go | 2 +- x/fundraising/types/msgs.go | 36 ++ x/fundraising/types/msgs_test.go | 34 ++ x/fundraising/types/tx.pb.go | 477 +++++++++++++++++++++--- 27 files changed, 1012 insertions(+), 262 deletions(-) create mode 100644 config-test.yml diff --git a/Makefile b/Makefile index 84f7aa4b..c1f423fc 100644 --- a/Makefile +++ b/Makefile @@ -162,6 +162,6 @@ proto-format: ############################################################################### localnet: - starport chain serve -v + starport chain serve -v -c ./config-test.yml .PHONY: localnet diff --git a/README.md b/README.md index 04969b05..ab442bdb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/client/docs/static/openapi.yml b/client/docs/static/openapi.yml index b8202923..b1da4bd9 100644 --- a/client/docs/static/openapi.yml +++ b/client/docs/static/openapi.yml @@ -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: @@ -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: |- diff --git a/config-test.yml b/config-test.yml new file mode 100644 index 00000000..77ad316e --- /dev/null +++ b/config-test.yml @@ -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"] \ No newline at end of file diff --git a/config.yml b/config.yml index bc867bfa..52e57ee3 100644 --- a/config.yml +++ b/config.yml @@ -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 @@ -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"] \ No newline at end of file diff --git a/docs/How-To/api/README.md b/docs/How-To/api/README.md index 798c2ce2..e194a459 100644 --- a/docs/How-To/api/README.md +++ b/docs/How-To/api/README.md @@ -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" } @@ -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" } @@ -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: diff --git a/docs/How-To/cli/README.md b/docs/How-To/cli/README.md index 4d9ad2fa..d46d2cfe 100644 --- a/docs/How-To/cli/README.md +++ b/docs/How-To/cli/README.md @@ -9,12 +9,13 @@ This document provides a high-level overview of how the command line (CLI) inter ## Command Line Interface -To test out the following commands, you must set up a local network. By simply running `make localnet` under the root project directory, you can start the local network. It requires [Starport](https://starport.com/), but if you don't have Starport set up in your local machine, see this [install Starport guide](https://docs.starport.network/) to install it. +To test out the following commands, you must set up a local network. By simply running `$ make localnet` under the root project directory, you can start the local network. It requires the latest [Starport](https://starport.com/). If you don't have `Starport` set up in your local machine, see this [Starport guide](https://docs.starport.network/) to install it. - [Transaction](#Transaction) * [CreateFixedPriceAuction](#CreateFixedPriceAuction) * [CreateEnglishAuction](#CreateEnglishAuction) * [CancelAuction](#CancelAuction) + * [AddAllowedBidder](#AddAllowedBidder) * [PlaceBid](#PlaceBid) - [Query](#Query) * [Params](#Params) @@ -53,21 +54,22 @@ In this JSON example, an auctioneer plans to create a fixed price auction that p "weight": "0.500000000000000000" } ], - "start_time": "2022-01-21T00:00:00Z", - "end_time": "2022-02-21T00:00:00Z" + "start_time": "2022-02-01T00:00:00Z", + "end_time": "2022-03-01T00:00:00Z" } ``` Reference the description of each field: -| **Field** | **Description** | -| :---------------- | :---------------------------------------------------------------------------- | -| start_price | The starting price of the selling coin, proportional to the paying coin denom | -| selling_coin | The selling amount of coin for the auction | -| paying_coin_denom | The paying coin denom that bidders use to bid with | -| vesting_schedules | The vesting schedules that release the paying coins to the autioneer | -| start_time | The start time of the auction | -| end_time | The end time of the auction | +| **Field** | **Description** | +| :---------------- | :---------------------------------------------------------------------------------- | +| start_price | The starting price of the selling coin; it is proportional to the paying coin denom | +| selling_coin | The selling amount of coin for the auction | +| paying_coin_denom | The paying coin denom that bidders use to bid with | +| vesting_schedules | The vesting schedules that release the paying coins to the autioneer | +| start_time | The start time of the auction | +| end_time | The end time of the auction | +| | | Example command: @@ -91,7 +93,7 @@ Result: "messages": [ { "@type": "/tendermint.fundraising.MsgCreateFixedPriceAuction", - "auctioneer": "cosmos1e9kp752fc6vs3n7enjcfjenfj9s7eehs3m7fdg", + "auctioneer": "cosmos1dncsflcfknkmlmt3t6836tkd3mu742e2wh4r70", "start_price": "1.000000000000000000", "selling_coin": { "denom": "denom1", @@ -108,8 +110,8 @@ Result: "weight": "0.500000000000000000" } ], - "start_time": "2022-01-21T00:00:00Z", - "end_time": "2022-02-21T00:00:00Z" + "start_time": "2022-02-01T00:00:00Z", + "end_time": "2022-03-01T00:00:00Z" } ], "memo": "", @@ -122,7 +124,7 @@ Result: { "public_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "Axm3aCxA77M5+SMNX7mQRCrdwWZdzpVtDIcmhfWINHMN" + "key": "A3mbh7d1pTgT3xSDyXHjdpcaxm58t0azRCXeGP0EsKsQ" }, "mode_info": { "single": { @@ -140,7 +142,7 @@ Result: } }, "signatures": [ - "3u2Pxxdmo9ISfYop70OXz353wNYSKgFgG5ug9t9/ECUBi/dBCiHb0WXiAg8IiyyIprQZPqIlly4HzrQSW6SZ0g==" + "UahsRZ27hATh0xu7M/IWFvNvaFESpQ+W0RmQhQql3ERsnYdTDrFP81/MxyYxuX4WNBUv4+3FyhOwEQ7hqlU+MQ==" ] } ``` @@ -150,13 +152,12 @@ Result: Example command: ```bash -TODO: It is actively being developed. +TODO: it is being developed ``` Result: ```json -TODO: It is actively being developed. ``` ### CancelAuction @@ -222,6 +223,74 @@ Result: } ``` +### AddAllowedBidder + +**Important Note**: the `fundraising` module is designed in a way that all auctions are closed when they are created. It means that no one can place a bid unless they are allowed. The module expects an external module (a module that imports and uses the `fundraising` module) to control a list of allowed bidder for an auction. There are functions, such as `AddAllowedBidders()` and `UpdateAllowedBidder()` implemented for the external module to use. + +For testing purpose, there is a custom message called `MsgAddAllowedBidder`. It adds a single allowed bidder for the auction and this message is only available when you build `fundraisingd` with `config-test.yml` file. Running `make localnet` is automatically using `config-test.yml`. Under the hood, a custom `enableAddAllowedBidder` ldflags is passed to build configuration in `config-test.yml` file. + +Example command: + +```bash +# Add steve's address to allowed bidder list +fundraisingd tx fundraising add-allowed-bidder 1 1000000000 \ +--chain-id fundraising \ +--from steve \ +--keyring-backend test \ +--broadcast-mode block \ +--yes \ +--output json | jq +``` + +Result: + +```json +{ + "@type": "/cosmos.tx.v1beta1.Tx", + "body": { + "messages": [ + { + "@type": "/tendermint.fundraising.MsgAddAllowedBidder", + "auction_id": "1", + "allowed_bidder": { + "bidder": "cosmos1tfzynkllgxdpmrcknx2j5d0hj9zd82tceyfa5n", + "max_bid_amount": "1000000000" + } + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A8VLxM/RDIlFEtOe7rfzA2Am55/Zam2n+oq1+I/Ovkbv" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "D49R49OD1YIBzdVVy5g1yIc8AvKbII6f8n3NpJDDHbY3O2vX/dwsoC2TX5eWRSXGgJ92+PfIZIek5PrsZWyfxQ==" + ] +} +``` + ### PlaceBid Example command: @@ -246,7 +315,7 @@ Result: { "@type": "/tendermint.fundraising.MsgPlaceBid", "auction_id": "1", - "bidder": "cosmos1nmd9ata0gl4agdspva84dwmmfe9ve70kjf4net", + "bidder": "cosmos1tfzynkllgxdpmrcknx2j5d0hj9zd82tceyfa5n", "price": "1.000000000000000000", "coin": { "denom": "denom2", @@ -264,14 +333,14 @@ Result: { "public_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "AteB2mOe5DTkDDZAONTDLetQQtRq8csugsYdKpYokoUN" + "key": "A8VLxM/RDIlFEtOe7rfzA2Am55/Zam2n+oq1+I/Ovkbv" }, "mode_info": { "single": { "mode": "SIGN_MODE_DIRECT" } }, - "sequence": "0" + "sequence": "1" } ], "fee": { @@ -282,7 +351,7 @@ Result: } }, "signatures": [ - "JVOzqwLIV/GjTwhZag1z+nfwHCFEHpDYLL79lSclhVAjPNBVaJKnbCcTMjxUBESGs1tcyxQuB+mn2GV8ZnrTCQ==" + "Ahrvo4CXneHxTd0Hgyt+HdZXmrhKhm1ijo5Tf7/K7OcK4P5590UlDpoqJ7ofLB738AGt+3rJ+cHy+K09KqBFaA==" ] } ``` @@ -308,7 +377,7 @@ fundraisingd q fundraising params --output json | jq } ], "extended_period": 1, - "auction_fee_collector": "cosmos1t2gp44cx86rt8gxv64lpt0dggveg98y4ma2wlnfqts7d4m4z70vqrzud4t" + "fee_collector_address": "cosmos1kxyag8zx2j9m8063m92qazaxqg63xv5h7z5jxz8yr27tuk67ne8q0lzjm9" } ``` @@ -344,17 +413,22 @@ Result: "base_auction": { "id": "1", "type": "AUCTION_TYPE_FIXED_PRICE", - "allowed_bidders": [], - "auctioneer": "cosmos1e9kp752fc6vs3n7enjcfjenfj9s7eehs3m7fdg", - "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": "1000000000000" }, "paying_coin_denom": "denom2", - "vesting_reserve_address": "cosmos1gukaqt783nhz79uhcqklsty7lc7jfyy8scn5ke4x7v0m3rkpt4dst7y4l3", + "vesting_reserve_address": "cosmos1q4x4k4qsr4jwrrugnplhlj52mfd9f8jn5ck7r4ykdpv9wczvz4dqe8vrvt", "vesting_schedules": [ { "release_time": "2022-06-21T00:00:00Z", @@ -370,9 +444,9 @@ Result: "denom": "denom1", "amount": "999995000000" }, - "start_time": "2022-01-21T00:00:00Z", + "start_time": "2022-02-01T00:00:00Z", "end_times": [ - "2022-02-21T00:00:00Z" + "2022-03-01T00:00:00Z" ], "status": "AUCTION_STATUS_STARTED" } @@ -403,17 +477,22 @@ Result: "base_auction": { "id": "1", "type": "AUCTION_TYPE_FIXED_PRICE", - "allowed_bidders": [], - "auctioneer": "cosmos1e9kp752fc6vs3n7enjcfjenfj9s7eehs3m7fdg", - "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": "1000000000000" }, "paying_coin_denom": "denom2", - "vesting_reserve_address": "cosmos1gukaqt783nhz79uhcqklsty7lc7jfyy8scn5ke4x7v0m3rkpt4dst7y4l3", + "vesting_reserve_address": "cosmos1q4x4k4qsr4jwrrugnplhlj52mfd9f8jn5ck7r4ykdpv9wczvz4dqe8vrvt", "vesting_schedules": [ { "release_time": "2022-06-21T00:00:00Z", @@ -429,9 +508,9 @@ Result: "denom": "denom1", "amount": "999995000000" }, - "start_time": "2022-01-21T00:00:00Z", + "start_time": "2022-02-01T00:00:00Z", "end_times": [ - "2022-02-21T00:00:00Z" + "2022-03-01T00:00:00Z" ], "status": "AUCTION_STATUS_STARTED" } @@ -457,13 +536,13 @@ Result: { "auction_id": "1", "sequence": "1", - "bidder": "cosmos1nmd9ata0gl4agdspva84dwmmfe9ve70kjf4net", + "bidder": "cosmos1tfzynkllgxdpmrcknx2j5d0hj9zd82tceyfa5n", "price": "1.000000000000000000", "coin": { "denom": "denom2", "amount": "5000000" }, - "height": "50", + "height": "1407", "eligible": true } ], diff --git a/proto/fundraising/fundraising.proto b/proto/fundraising/fundraising.proto index b0eaa6e2..5567c92b 100644 --- a/proto/fundraising/fundraising.proto +++ b/proto/fundraising/fundraising.proto @@ -50,7 +50,7 @@ message BaseAuction { // allowed_bidders specifies the bidders who are allowed to bid for the // auction - repeated AllowedBidder allowed_bidders = 3; + repeated AllowedBidder allowed_bidders = 3 [ (gogoproto.nullable) = false ]; // auctioneer specifies the bech32-encoded address that creates the auction string auctioneer = 4; diff --git a/proto/fundraising/tx.proto b/proto/fundraising/tx.proto index bcd138e3..87ff3d30 100644 --- a/proto/fundraising/tx.proto +++ b/proto/fundraising/tx.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package tendermint.fundraising; -// this line is used by starport scaffolding # proto/tx/import import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -11,20 +10,25 @@ option go_package = "github.com/tendermint/fundraising/x/fundraising/types"; // Msg defines the Msg service. service Msg { - // this line is used by starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + // CreateFixedPriceAuction defines a method to create a FixedPrice auction + // message. rpc CreateFixedPriceAuction(MsgCreateFixedPriceAuction) returns (MsgCreateFixedPriceAuctionResponse); - // Submit a create english auction message. + // CreateEnglishAuction defines a method to create an English auction message rpc CreateEnglishAuction(MsgCreateEnglishAuction) returns (MsgCreateEnglishAuctionResponse); - // Submit a cancel auction message. + // CancelAuction defines a method to cancel the auction message. rpc CancelAuction(MsgCancelAuction) returns (MsgCancelAuctionResponse); - // Submit a PlaceBid message to the certain fundraising. + // PlaceBid defines a method to place a bid message. rpc PlaceBid(MsgPlaceBid) returns (MsgPlaceBidResponse); + + // AddAllowedBidder defines a method sto add a single allowed bidder message. + // This is for the testing purpose and it must not be used in mainnet. + rpc AddAllowedBidder(MsgAddAllowedBidder) + returns (MsgAddAllowedBidderResponse); } // this line is used by starport scaffolding # proto/tx/message @@ -171,3 +175,18 @@ message MsgPlaceBid { // id specifies index of the auction // MsgPlaceBidResponse defines the Msg/MsgPlaceBidResponse response type. message MsgPlaceBidResponse {} + +// MsgAddAllowedBidder defines a SDK message for adding an allowed bidder to the +// auction. +message MsgAddAllowedBidder { + option (gogoproto.goproto_getters) = false; + + // auction_id specifies the auction id + uint64 auction_id = 1; + + // allowed_bidder specifies the bidder who is allowed to bid and their maximum + // bid amount + AllowedBidder allowed_bidder = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgAddAllowedBidderResponse {} \ No newline at end of file diff --git a/x/fundraising/client/cli/tx.go b/x/fundraising/client/cli/tx.go index 10f18ba5..94cb0449 100644 --- a/x/fundraising/client/cli/tx.go +++ b/x/fundraising/client/cli/tx.go @@ -14,6 +14,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/version" + "github.com/tendermint/fundraising/x/fundraising/keeper" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -27,13 +28,15 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 cmd.AddCommand( NewCreateFixedPriceAuction(), NewCreateEnglishAuction(), NewCancelAuction(), NewPlaceBid(), ) + if keeper.EnableAddAllowedBidder { + cmd.AddCommand(NewAddAllowedBidderCmd()) + } return cmd } @@ -248,3 +251,51 @@ in order to bid for the amount of coin you bid for the auction. return cmd } + +func NewAddAllowedBidderCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-allowed-bidder [auction-id] [max-bid-amount]", + Args: cobra.ExactArgs(2), + Short: "(Testing) Add an allowed bidder for the auction", + Long: strings.TrimSpace( + fmt.Sprintf(`Add an allowed bidder for the auction. +This message is available for testing purpose and it is only accessible when you build the binary with testing mode. + +Example: +$ %s tx %s add-allowed-bidder 1 10000000000 --from mykey +`, + version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + auctionId, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + maxBidAmt, ok := sdk.NewIntFromString(args[1]) + if !ok { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "maxium bid price must be a positive integer") + } + + msg := types.NewAddAllowedBidder( + auctionId, + types.AllowedBidder{ + Bidder: clientCtx.GetFromAddress().String(), + MaxBidAmount: maxBidAmt, + }, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/fundraising/handler.go b/x/fundraising/handler.go index 02905a8d..d9feb689 100644 --- a/x/fundraising/handler.go +++ b/x/fundraising/handler.go @@ -33,6 +33,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.PlaceBid(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgAddAllowedBidder: + res, err := msgServer.AddAllowedBidder(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg)) } diff --git a/x/fundraising/keeper/auction.go b/x/fundraising/keeper/auction.go index 495652ac..cdd4451d 100644 --- a/x/fundraising/keeper/auction.go +++ b/x/fundraising/keeper/auction.go @@ -226,7 +226,7 @@ func (k Keeper) CancelAuction(ctx sdk.Context, msg *types.MsgCancelAuction) (typ // AddAllowedBidders is a function for an external module and it simply adds new bidder(s) to AllowedBidder list. // Note that it doesn't do auctioneer verification because the module is generalized for broader use cases. // It is designed to delegate to an external module to add necessary verification and logics depending on their use case. -func (k Keeper) AddAllowedBidders(ctx sdk.Context, auctionId uint64, bidders []*types.AllowedBidder) error { +func (k Keeper) AddAllowedBidders(ctx sdk.Context, auctionId uint64, bidders []types.AllowedBidder) error { auction, found := k.GetAuction(ctx, auctionId) if !found { return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "auction %d is not found", auctionId) @@ -272,9 +272,9 @@ func (k Keeper) UpdateAllowedBidder(ctx sdk.Context, auctionId uint64, bidder sd allowedBidders := auction.GetAllowedBidders() allowedBiddersMap := make(map[string]sdk.Int) // map(bidderAddress => maxBidAmount) - for _, b := range allowedBidders { + for i, b := range allowedBidders { if b.Bidder == bidder.String() { - b.MaxBidAmount = maxBidAmount // update the bidder's maximum bid amount + allowedBidders[i].MaxBidAmount = maxBidAmount // update the bidder's maximum bid amount } allowedBiddersMap[b.GetBidder()] = b.MaxBidAmount diff --git a/x/fundraising/keeper/auction_test.go b/x/fundraising/keeper/auction_test.go index 8210f137..9a89026f 100644 --- a/x/fundraising/keeper/auction_test.go +++ b/x/fundraising/keeper/auction_test.go @@ -2,6 +2,7 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tendermint/fundraising/x/fundraising" "github.com/tendermint/fundraising/x/fundraising/types" @@ -273,12 +274,12 @@ func (s *KeeperTestSuite) TestAddAllowedBidder() { for _, tc := range []struct { name string - bidders []*types.AllowedBidder + bidders []types.AllowedBidder expectedErr error }{ { "single bidder", - []*types.AllowedBidder{ + []types.AllowedBidder{ { Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000), @@ -288,7 +289,7 @@ func (s *KeeperTestSuite) TestAddAllowedBidder() { }, { "multiple bidders", - []*types.AllowedBidder{ + []types.AllowedBidder{ { Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000), @@ -307,12 +308,12 @@ func (s *KeeperTestSuite) TestAddAllowedBidder() { { "empty bidders", - []*types.AllowedBidder{}, + []types.AllowedBidder{}, types.ErrEmptyAllowedBidders, }, { "zero maximum bid amount value", - []*types.AllowedBidder{ + []types.AllowedBidder{ { Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(0), @@ -322,7 +323,7 @@ func (s *KeeperTestSuite) TestAddAllowedBidder() { }, { "negative maximum bid amount value", - []*types.AllowedBidder{ + []types.AllowedBidder{ { Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(-1), @@ -358,7 +359,7 @@ func (s *KeeperTestSuite) TestAddAllowedBidderLength() { s.Require().Len(auction.GetAllowedBidders(), 0) // Add some bidders - err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ { Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000), @@ -375,7 +376,7 @@ func (s *KeeperTestSuite) TestAddAllowedBidderLength() { s.Require().Len(auction.GetAllowedBidders(), 2) // Add more bidders - err = s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []*types.AllowedBidder{ + err = s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ { Bidder: s.addr(3).String(), MaxBidAmount: sdk.NewInt(100_000_000), @@ -413,7 +414,7 @@ func (s *KeeperTestSuite) TestUpdateAllowedBidder() { s.Require().Len(auction.GetAllowedBidders(), 0) // Add 5 bidders with different maximum bid amount - err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(100_000_000)}, {Bidder: s.addr(2).String(), MaxBidAmount: sdk.NewInt(200_000_000)}, {Bidder: s.addr(3).String(), MaxBidAmount: sdk.NewInt(300_000_000)}, @@ -438,24 +439,24 @@ func (s *KeeperTestSuite) TestUpdateAllowedBidder() { sdk.NewInt(555_000_000_000), nil, }, - // { - // "bidder not found", - // s.addr(10), - // sdk.NewInt(300_000_000), - // sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bidder %s is not found", s.addr(10).String()), - // }, - // { - // "zero maximum bid amount value", - // s.addr(1), - // sdk.NewInt(0), - // types.ErrInvalidMaxBidAmount, - // }, - // { - // "negative maximum bid amount value", - // s.addr(1), - // sdk.NewInt(-1), - // types.ErrInvalidMaxBidAmount, - // }, + { + "bidder not found", + s.addr(10), + sdk.NewInt(300_000_000), + sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bidder %s is not found", s.addr(10).String()), + }, + { + "zero maximum bid amount value", + s.addr(1), + sdk.NewInt(0), + types.ErrInvalidMaxBidAmount, + }, + { + "negative maximum bid amount value", + s.addr(1), + sdk.NewInt(-1), + types.ErrInvalidMaxBidAmount, + }, } { s.Run(tc.name, func() { err := s.keeper.UpdateAllowedBidder(s.ctx, auction.GetId(), tc.bidder, tc.maxBidAmount) diff --git a/x/fundraising/keeper/bid_test.go b/x/fundraising/keeper/bid_test.go index 797cf574..445feed1 100644 --- a/x/fundraising/keeper/bid_test.go +++ b/x/fundraising/keeper/bid_test.go @@ -103,7 +103,7 @@ func (s *KeeperTestSuite) TestPlaceBid() { notAllowedBidder := s.addr(2) // Add allowed bidder to allowed bidder list - err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, auction.GetId(), []types.AllowedBidder{ {Bidder: s.addr(1).String(), MaxBidAmount: sdk.NewInt(10_000_000)}, }) s.Require().NoError(err) diff --git a/x/fundraising/keeper/keeper.go b/x/fundraising/keeper/keeper.go index 6fd9aa4e..e0bf5392 100644 --- a/x/fundraising/keeper/keeper.go +++ b/x/fundraising/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "strconv" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,6 +12,23 @@ import ( "github.com/tendermint/fundraising/x/fundraising/types" ) +var ( + // Set this to "true" using testing build flag to enable AddAllowedBidder msg in Makefile + enableAddAllowedBidder = "false" + + // EnableAddAllowedBidder indicates whether msgServer accepts MsgAddAllowedBidder or not. + // Never set this to true in production environment. Doing that will expose serious attack vector. + EnableAddAllowedBidder = false +) + +func init() { + var err error + EnableAddAllowedBidder, err = strconv.ParseBool(enableAddAllowedBidder) + if err != nil { + panic(err) + } +} + type Keeper struct { cdc codec.BinaryCodec storeKey sdk.StoreKey diff --git a/x/fundraising/keeper/keeper_test.go b/x/fundraising/keeper/keeper_test.go index 3a3f3c00..529728c1 100644 --- a/x/fundraising/keeper/keeper_test.go +++ b/x/fundraising/keeper/keeper_test.go @@ -130,7 +130,7 @@ func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, coins sdk.Coins) { } func (s *KeeperTestSuite) addAllowedBidder(auctionId uint64, bidder sdk.AccAddress, maxBidAmount sdk.Int) { - err := s.keeper.AddAllowedBidders(s.ctx, auctionId, []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, auctionId, []types.AllowedBidder{ { Bidder: bidder.String(), MaxBidAmount: maxBidAmount, diff --git a/x/fundraising/keeper/msg_server.go b/x/fundraising/keeper/msg_server.go index dedbf9a0..45f4c889 100644 --- a/x/fundraising/keeper/msg_server.go +++ b/x/fundraising/keeper/msg_server.go @@ -9,6 +9,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tendermint/fundraising/x/fundraising/types" ) @@ -63,3 +64,19 @@ func (m msgServer) PlaceBid(goCtx context.Context, msg *types.MsgPlaceBid) (*typ return &types.MsgPlaceBidResponse{}, nil } + +// AddAllowedBidder defines a method to add an allowed bidder. +// This message is created for testing purpose and it must not be used in mainnet. +func (m msgServer) AddAllowedBidder(goCtx context.Context, msg *types.MsgAddAllowedBidder) (*types.MsgAddAllowedBidderResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if EnableAddAllowedBidder { + if err := m.Keeper.AddAllowedBidders(ctx, msg.AuctionId, []types.AllowedBidder{msg.AllowedBidder}); err != nil { + return nil, err + } + } else { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "EnableAddAllowedBidder is disabled") + } + + return &types.MsgAddAllowedBidderResponse{}, nil +} diff --git a/x/fundraising/keeper/msg_server_test.go b/x/fundraising/keeper/msg_server_test.go index 21c8502b..b1ca8071 100644 --- a/x/fundraising/keeper/msg_server_test.go +++ b/x/fundraising/keeper/msg_server_test.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/tendermint/fundraising/x/fundraising/keeper" "github.com/tendermint/fundraising/x/fundraising/types" _ "github.com/stretchr/testify/suite" @@ -144,7 +145,7 @@ func (s *KeeperTestSuite) TestMsgPlaceBid() { "denom2", []types.VestingSchedule{}, types.MustParseRFC3339("2022-01-01T00:00:00Z"), - types.MustParseRFC3339("2022-03-01T00:00:00Z"), + types.MustParseRFC3339("2022-06-01T00:00:00Z"), true, ) s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) @@ -202,7 +203,7 @@ func (s *KeeperTestSuite) TestMsgPlaceBid() { s.Run(tc.name, func() { receiveAmt := tc.msg.Coin.Amount.ToDec().QuoTruncate(tc.msg.Price).TruncateInt() - err := s.keeper.AddAllowedBidders(s.ctx, tc.msg.AuctionId, []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, tc.msg.AuctionId, []types.AllowedBidder{ {Bidder: bidder.String(), MaxBidAmount: receiveAmt}, }) s.Require().NoError(err) @@ -216,3 +217,62 @@ func (s *KeeperTestSuite) TestMsgPlaceBid() { }) } } + +func (s *KeeperTestSuite) TestMsgAddAllowedBidder() { + ctx := sdk.WrapSDKContext(s.ctx) + + auction := s.createFixedPriceAuction( + s.addr(0), + sdk.MustNewDecFromStr("0.5"), + sdk.NewInt64Coin("denom1", 500_000_000_000), + "denom2", + []types.VestingSchedule{}, + types.MustParseRFC3339("2022-01-01T00:00:00Z"), + types.MustParseRFC3339("2022-06-01T00:00:00Z"), + true, + ) + s.Require().Equal(types.AuctionStatusStarted, auction.GetStatus()) + + for _, tc := range []struct { + name string + msg *types.MsgAddAllowedBidder + enableAddAllowedBidder bool + err error + }{ + { + "valid", + types.NewAddAllowedBidder( + auction.GetId(), + types.AllowedBidder{ + Bidder: s.addr(1).String(), + MaxBidAmount: sdk.NewInt(100000000), + }, + ), + true, + nil, + }, + { + "invalid", + types.NewAddAllowedBidder( + auction.GetId(), + types.AllowedBidder{ + Bidder: s.addr(1).String(), + MaxBidAmount: sdk.NewInt(100000000), + }, + ), + false, + sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "EnableAddAllowedBidder is disabled"), + }, + } { + s.Run(tc.name, func() { + keeper.EnableAddAllowedBidder = tc.enableAddAllowedBidder + + _, err := s.msgServer.AddAllowedBidder(ctx, tc.msg) + if tc.err != nil { + s.Require().ErrorIs(err, tc.err) + return + } + s.Require().NoError(err) + }) + } +} diff --git a/x/fundraising/module_test.go b/x/fundraising/module_test.go index faae009e..afb95dea 100644 --- a/x/fundraising/module_test.go +++ b/x/fundraising/module_test.go @@ -84,7 +84,7 @@ func (s *ModuleTestSuite) placeBid(auctionId uint64, bidder sdk.AccAddress, pric receiveAmt := coin.Amount.ToDec().QuoTruncate(price).TruncateInt() - err := s.keeper.AddAllowedBidders(s.ctx, auctionId, []*types.AllowedBidder{ + err := s.keeper.AddAllowedBidders(s.ctx, auctionId, []types.AllowedBidder{ {Bidder: bidder.String(), MaxBidAmount: receiveAmt}, }) s.Require().NoError(err) diff --git a/x/fundraising/spec/04_messages.md b/x/fundraising/spec/04_messages.md index a0dc775c..a18bf0ae 100644 --- a/x/fundraising/spec/04_messages.md +++ b/x/fundraising/spec/04_messages.md @@ -55,4 +55,22 @@ type MsgPlaceBid struct { Price sdk.Dec // bid price to bid for the auction Coin sdk.Coin // paying amount of coin that the bidder bids } +``` + + +## MsgAddAllowedBidder + +This message is a custom message that is created for testing purpose only. It adds an allowed bidder to `AllowedBidders` for the auction. +It is accessible when you build `fundraisingd` binary by the following command: + +```bash +make install-testing +``` + +```go +// MsgAddAllowedBidder defines a SDK message to add an allowed bidder +type MsgAddAllowedBidder struct { + AuctionId uint64 // the id of the auction + AllowedBidder AllowedBidder // the bidder and their maximum bid amount +} ``` \ No newline at end of file diff --git a/x/fundraising/types/auction.go b/x/fundraising/types/auction.go index 8d82171e..a2e4eb57 100644 --- a/x/fundraising/types/auction.go +++ b/x/fundraising/types/auction.go @@ -39,8 +39,8 @@ type AuctionI interface { GetType() AuctionType SetType(AuctionType) error - GetAllowedBidders() []*AllowedBidder - SetAllowedBidders([]*AllowedBidder) error + GetAllowedBidders() []AllowedBidder + SetAllowedBidders([]AllowedBidder) error GetAuctioneer() sdk.AccAddress SetAuctioneer(sdk.AccAddress) error @@ -90,7 +90,7 @@ type AuctionI interface { // NewBaseAuction creates a new BaseAuction object //nolint:interfacer func NewBaseAuction( - id uint64, typ AuctionType, allowedBidders []*AllowedBidder, auctioneerAddr string, + id uint64, typ AuctionType, allowedBidders []AllowedBidder, auctioneerAddr string, sellingPoolAddr string, payingPoolAddr string, startPrice sdk.Dec, sellingCoin sdk.Coin, payingCoinDenom string, vestingPoolAddr string, vestingSchedules []VestingSchedule, winningPrice sdk.Dec, remainingCoin sdk.Coin, startTime time.Time, @@ -134,11 +134,11 @@ func (ba *BaseAuction) SetType(typ AuctionType) error { return nil } -func (ba BaseAuction) GetAllowedBidders() []*AllowedBidder { +func (ba BaseAuction) GetAllowedBidders() []AllowedBidder { return ba.AllowedBidders } -func (ba *BaseAuction) SetAllowedBidders(bidders []*AllowedBidder) error { +func (ba *BaseAuction) SetAllowedBidders(bidders []AllowedBidder) error { ba.AllowedBidders = bidders return nil } @@ -434,7 +434,7 @@ func VestingReserveAddress(auctionId uint64) sdk.AccAddress { } // ValidatorAllowedBidders validates allowed bidders. -func ValidatorAllowedBidders(bidders []*AllowedBidder) error { +func ValidatorAllowedBidders(bidders []AllowedBidder) error { for _, bidder := range bidders { if bidder.MaxBidAmount.IsNil() { return ErrInvalidMaxBidAmount diff --git a/x/fundraising/types/codec.go b/x/fundraising/types/codec.go index 7c79ee64..d204e377 100644 --- a/x/fundraising/types/codec.go +++ b/x/fundraising/types/codec.go @@ -17,6 +17,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgCreateEnglishAuction{}, &MsgCancelAuction{}, &MsgPlaceBid{}, + &MsgAddAllowedBidder{}, ) registry.RegisterInterface( diff --git a/x/fundraising/types/fundraising.pb.go b/x/fundraising/types/fundraising.pb.go index 3177727a..bed76a12 100644 --- a/x/fundraising/types/fundraising.pb.go +++ b/x/fundraising/types/fundraising.pb.go @@ -191,7 +191,7 @@ type BaseAuction struct { Type AuctionType `protobuf:"varint,2,opt,name=type,proto3,enum=tendermint.fundraising.AuctionType" json:"type,omitempty"` // allowed_bidders specifies the bidders who are allowed to bid for the // auction - AllowedBidders []*AllowedBidder `protobuf:"bytes,3,rep,name=allowed_bidders,json=allowedBidders,proto3" json:"allowed_bidders,omitempty"` + AllowedBidders []AllowedBidder `protobuf:"bytes,3,rep,name=allowed_bidders,json=allowedBidders,proto3" json:"allowed_bidders"` // auctioneer specifies the bech32-encoded address that creates the auction Auctioneer string `protobuf:"bytes,4,opt,name=auctioneer,proto3" json:"auctioneer,omitempty"` // selling_reserve_address specifies the bech32-encoded address that has all @@ -636,95 +636,95 @@ func init() { proto.RegisterFile("fundraising/fundraising.proto", fileDescriptor var fileDescriptor_a97a388085f27061 = []byte{ // 1417 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0xf7, 0x3a, 0x4e, 0xbe, 0xce, 0xf8, 0x47, 0xcc, 0x7c, 0x13, 0x77, 0xd9, 0x16, 0xdb, 0x72, - 0x45, 0x89, 0x90, 0xb0, 0x43, 0xa0, 0xa5, 0x8a, 0xd4, 0x83, 0xd7, 0x5e, 0x83, 0xa5, 0xc8, 0x49, - 0x77, 0x0d, 0x2a, 0x1c, 0xba, 0x5a, 0x7b, 0x27, 0xce, 0x88, 0xfd, 0x61, 0x76, 0xd6, 0x21, 0x3e, - 0xf4, 0x8e, 0x72, 0xe2, 0xd8, 0x43, 0xa3, 0xa2, 0xf6, 0x86, 0x54, 0xa9, 0xaa, 0xfa, 0x47, 0x70, - 0xe8, 0x01, 0x55, 0xaa, 0x54, 0xf5, 0x90, 0x54, 0xf0, 0x1f, 0xf0, 0x17, 0x54, 0xf3, 0xc3, 0x8e, - 0xed, 0x98, 0x02, 0x11, 0x3d, 0xc5, 0xef, 0xcd, 0x7c, 0xde, 0xbc, 0xf9, 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0x22, 0xf7, 0x3e, 0x1d, 0x1b, 0x86, 0x93, 0x57, 0x73, 0xfc, 0xff, 0xc2, - 0xf2, 0xfe, 0x84, 0xc5, 0xe6, 0xa3, 0xbd, 0xc0, 0xb4, 0xed, 0xda, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xf4, 0x59, 0x74, 0x9b, 0x4d, 0x0e, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4d, 0x6f, 0x13, 0x57, + 0x17, 0xf6, 0x38, 0x4e, 0x5e, 0xe7, 0xfa, 0x23, 0xe6, 0xbe, 0x89, 0x3b, 0x4c, 0x8b, 0x6d, 0xb9, + 0xa2, 0x44, 0x48, 0xd8, 0x21, 0xd0, 0x52, 0x45, 0xea, 0xc2, 0x63, 0x8f, 0xc1, 0x52, 0xe4, 0xa4, + 0x33, 0x06, 0x15, 0x16, 0x1d, 0x8d, 0x3d, 0x37, 0xce, 0x15, 0xf3, 0x61, 0xe6, 0x8e, 0x43, 0xbc, + 0xe8, 0x1e, 0x65, 0xc5, 0xb2, 0x8b, 0x46, 0x45, 0xed, 0x0e, 0xa9, 0x52, 0x55, 0xf5, 0x47, 0xb0, + 0xe8, 0x02, 0x75, 0x55, 0xb5, 0x52, 0x52, 0xc1, 0x3f, 0xe0, 0x17, 0x54, 0xf7, 0xc3, 0x8e, 0xed, + 0x98, 0x02, 0x11, 0x5d, 0x79, 0xce, 0xb9, 0xf7, 0x39, 0xf7, 0xcc, 0x73, 0xce, 0x79, 0xee, 0x18, + 0x5c, 0xd8, 0xe9, 0x7b, 0x76, 0x60, 0x61, 0x82, 0xbd, 0x6e, 0x79, 0xec, 0xb9, 0xd4, 0x0b, 0xfc, + 0xd0, 0x87, 0xd9, 0x10, 0x79, 0x36, 0x0a, 0x5c, 0xec, 0x85, 0xa5, 0xb1, 0x55, 0x25, 0xd7, 0xf1, + 0x89, 0xeb, 0x93, 0x72, 0xdb, 0x22, 0xa8, 0xbc, 0x77, 0xb5, 0x8d, 0x42, 0xeb, 0x6a, 0xb9, 0xe3, + 0x63, 0x8f, 0xe3, 0x94, 0xf3, 0x7c, 0xdd, 0x64, 0x56, 0x99, 0x1b, 0x62, 0x69, 0xb9, 0xeb, 0x77, + 0x7d, 0xee, 0xa7, 0x4f, 0xc2, 0x9b, 0xef, 0xfa, 0x7e, 0xd7, 0x41, 0x65, 0x66, 0xb5, 0xfb, 0x3b, + 0xe5, 0x10, 0xbb, 0x88, 0x84, 0x96, 0xdb, 0xe3, 0x1b, 0x8a, 0xbf, 0x45, 0xc1, 0xc2, 0xb6, 0x15, + 0x58, 0x2e, 0x81, 0xdf, 0x49, 0x60, 0xd9, 0xea, 0x77, 0x42, 0xec, 0x7b, 0x66, 0x27, 0x40, 0x16, + 0x7b, 0xd8, 0x41, 0x48, 0x96, 0x0a, 0x73, 0xab, 0x89, 0xf5, 0xf3, 0x25, 0x71, 0x1e, 0x4d, 0xae, + 0x24, 0x92, 0x2b, 0x55, 0x7d, 0xec, 0xa9, 0x5b, 0xcf, 0x8e, 0xf2, 0x91, 0x57, 0x47, 0xf9, 0x0f, + 0x07, 0x96, 0xeb, 0x6c, 0x14, 0x67, 0x05, 0x29, 0x3e, 0x3d, 0xce, 0xaf, 0x76, 0x71, 0xb8, 0xdb, + 0x6f, 0x97, 0x3a, 0xbe, 0x2b, 0x72, 0x17, 0x3f, 0x57, 0x88, 0x7d, 0xbf, 0x1c, 0x0e, 0x7a, 0x88, + 0xb0, 0x78, 0x44, 0x87, 0x22, 0x44, 0x55, 0x44, 0xa8, 0x23, 0x04, 0xab, 0x60, 0x09, 0xed, 0x33, + 0xde, 0x6c, 0xb3, 0x87, 0x02, 0xec, 0xdb, 0x72, 0xb4, 0x20, 0xad, 0xa6, 0x54, 0xe5, 0xd5, 0x51, + 0x3e, 0xcb, 0x4f, 0x9e, 0xda, 0x50, 0xd4, 0xd3, 0x43, 0xcf, 0x36, 0x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0x32, 0x5f, 0x9d, 0x42, 0x6d, 0x81, 0x04, 0x09, 0xad, 0x20, 0x34, 0x7b, 0x01, 0xee, + 0x20, 0xf9, 0x7f, 0xac, 0x24, 0x25, 0x9a, 0xf8, 0x9f, 0x47, 0xf9, 0x4f, 0xde, 0xa2, 0x79, 0x6a, + 0xa8, 0xa3, 0x03, 0x16, 0x62, 0x9b, 0x46, 0x80, 0x2e, 0x48, 0x0e, 0xd3, 0xa7, 0x43, 0x24, 0xc7, + 0x0b, 0xd2, 0xbf, 0x37, 0x72, 0x99, 0x1e, 0xf6, 0xf4, 0x38, 0x7f, 0xe9, 0x2d, 0x3b, 0x55, 0x4f, + 0x88, 0xf8, 0xd4, 0x80, 0x97, 0xc1, 0x39, 0xf1, 0xd6, 0xf4, 0x34, 0xd3, 0x46, 0x9e, 0xef, 0xca, + 0x8b, 0xec, 0x85, 0x97, 0xf8, 0x02, 0xdd, 0x56, 0xa3, 0x6e, 0xca, 0xec, 0x1e, 0x22, 0xe1, 0x2c, + 0x8a, 0x00, 0x67, 0x56, 0x2c, 0x4f, 0x71, 0x74, 0x0f, 0x9c, 0x1b, 0xe2, 0x48, 0x67, 0x17, 0xd9, + 0x7d, 0x07, 0x11, 0x39, 0xc1, 0x3a, 0xe1, 0xd2, 0xeb, 0x3a, 0xe1, 0x0e, 0x07, 0x18, 0x62, 0xbf, + 0xe8, 0x85, 0xcc, 0xde, 0xa4, 0x9b, 0x40, 0x03, 0xa4, 0x1e, 0x62, 0xcf, 0xa3, 0xb1, 0x79, 0x05, + 0x92, 0x67, 0xaa, 0x40, 0x52, 0x04, 0xe1, 0x35, 0x78, 0x00, 0xd2, 0x01, 0x72, 0x2d, 0xec, 0x8d, + 0xaa, 0x90, 0x7a, 0xef, 0x55, 0x48, 0x8d, 0x4e, 0x60, 0x75, 0xa8, 0x02, 0xde, 0x04, 0x26, 0x15, + 0x3b, 0x39, 0xcd, 0x8e, 0x53, 0x4a, 0x5c, 0x09, 0x4b, 0x43, 0x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x33, 0x37, + 0x03, 0x25, 0x64, 0x86, 0x7e, 0xe5, 0x4c, 0xa1, 0xea, 0x8d, 0x66, 0xc3, 0xb8, 0xa5, 0xd5, 0x32, + 0xb1, 0x09, 0x66, 0x39, 0xac, 0x8e, 0x3d, 0x4c, 0x76, 0x91, 0x0d, 0x3f, 0x3f, 0x29, 0x89, 0xc0, + 0x55, 0x2b, 0xcd, 0xaa, 0xb6, 0xb9, 0xa9, 0xd5, 0x32, 0xf3, 0x8a, 0x72, 0x70, 0x58, 0xc8, 0x4e, + 0x00, 0xab, 0x96, 0xd7, 0x41, 0x8e, 0x83, 0x6c, 0xc1, 0xf0, 0x00, 0x24, 0xc4, 0x07, 0x13, 0xeb, + 0x89, 0xab, 0x60, 0xa5, 0x52, 0xab, 0xe9, 0x9a, 0x61, 0xf0, 0x42, 0x5d, 0x5b, 0x37, 0xd5, 0xbb, + 0x2d, 0xcd, 0xc8, 0x44, 0x44, 0xa5, 0x4e, 0xf6, 0x5e, 0x5b, 0x57, 0x07, 0x21, 0x22, 0xa7, 0x20, + 0xeb, 0x6b, 0x02, 0x22, 0x9d, 0x82, 0xac, 0xaf, 0x31, 0x08, 0x3f, 0x5a, 0xdd, 0x7a, 0xf6, 0x22, + 0x27, 0x3d, 0x7f, 0x91, 0x93, 0xfe, 0x7e, 0x91, 0x93, 0x1e, 0xbf, 0xcc, 0x45, 0x9e, 0xbf, 0xcc, + 0x45, 0xfe, 0x78, 0x99, 0x8b, 0xdc, 0xfb, 0x74, 0x6c, 0x18, 0x4e, 0x6e, 0xcd, 0xf1, 0x7f, 0x87, + 0xe5, 0xfd, 0x09, 0x8b, 0xcd, 0x47, 0x7b, 0x81, 0x69, 0xdb, 0xb5, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xde, 0x60, 0x0a, 0xf6, 0x53, 0x0e, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -1702,7 +1702,7 @@ func (m *BaseAuction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllowedBidders = append(m.AllowedBidders, &AllowedBidder{}) + m.AllowedBidders = append(m.AllowedBidders, AllowedBidder{}) if err := m.AllowedBidders[len(m.AllowedBidders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/fundraising/types/genesis_test.go b/x/fundraising/types/genesis_test.go index 97539cdc..7546b30b 100644 --- a/x/fundraising/types/genesis_test.go +++ b/x/fundraising/types/genesis_test.go @@ -270,7 +270,7 @@ func TestGenesisState_Validate(t *testing.T) { Id: 1, Type: types.AuctionTypeFixedPrice, Auctioneer: validAddr.String(), - AllowedBidders: []*types.AllowedBidder{ + AllowedBidders: []types.AllowedBidder{ { Bidder: sdk.AccAddress(crypto.AddressHash([]byte("validBidder"))).String(), MaxBidAmount: sdk.ZeroInt(), diff --git a/x/fundraising/types/msgs.go b/x/fundraising/types/msgs.go index 6d510bf8..99698861 100644 --- a/x/fundraising/types/msgs.go +++ b/x/fundraising/types/msgs.go @@ -13,6 +13,7 @@ var ( _ sdk.Msg = (*MsgCreateEnglishAuction)(nil) _ sdk.Msg = (*MsgCancelAuction)(nil) _ sdk.Msg = (*MsgPlaceBid)(nil) + _ sdk.Msg = (*MsgAddAllowedBidder)(nil) ) // Message types for the fundraising module. @@ -21,6 +22,7 @@ const ( TypeMsgCreateEnglishAuction = "create_english_auction" TypeMsgCancelAuction = "cancel_auction" TypeMsgPlaceBid = "place_bid" + TypeMsgAddAllowedBidder = "add_allowed_bidder" ) // NewMsgCreateFixedPriceAuction creates a new MsgCreateFixedPriceAuction. @@ -275,3 +277,37 @@ func (msg MsgPlaceBid) GetBidder() sdk.AccAddress { } return addr } + +// NewAddAllowedBidder creates a new MsgAddAllowedBidder. +func NewAddAllowedBidder( + auctionId uint64, + allowedBidder AllowedBidder, +) *MsgAddAllowedBidder { + return &MsgAddAllowedBidder{ + AuctionId: auctionId, + AllowedBidder: allowedBidder, + } +} + +func (msg MsgAddAllowedBidder) Route() string { return RouterKey } + +func (msg MsgAddAllowedBidder) Type() string { return TypeMsgAddAllowedBidder } + +func (msg MsgAddAllowedBidder) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.AllowedBidder.Bidder); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid bidder address: %v", err) + } + return nil +} + +func (msg MsgAddAllowedBidder) GetSignBytes() []byte { + return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) +} + +func (msg MsgAddAllowedBidder) GetSigners() []sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(msg.AllowedBidder.Bidder) + if err != nil { + panic(err) + } + return []sdk.AccAddress{addr} +} diff --git a/x/fundraising/types/msgs_test.go b/x/fundraising/types/msgs_test.go index 81115228..0a8c8247 100644 --- a/x/fundraising/types/msgs_test.go +++ b/x/fundraising/types/msgs_test.go @@ -283,3 +283,37 @@ func TestMsgPlaceBid(t *testing.T) { } } } + +func TestAddAllowedBidder(t *testing.T) { + testCases := []struct { + expectedErr string + msg *types.MsgAddAllowedBidder + }{ + { + "", // empty means no error expected + types.NewAddAllowedBidder( + uint64(1), + types.AllowedBidder{ + sdk.AccAddress(crypto.AddressHash([]byte("Bidder"))).String(), + sdk.NewInt(100_000_000), + }, + ), + }, + } + + for _, tc := range testCases { + require.IsType(t, &types.MsgAddAllowedBidder{}, tc.msg) + require.Equal(t, types.TypeMsgAddAllowedBidder, tc.msg.Type()) + require.Equal(t, types.RouterKey, tc.msg.Route()) + require.Equal(t, sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(tc.msg)), tc.msg.GetSignBytes()) + + err := tc.msg.ValidateBasic() + if tc.expectedErr == "" { + require.Nil(t, err) + signers := tc.msg.GetSigners() + require.Len(t, signers, 1) + } else { + require.EqualError(t, err, tc.expectedErr) + } + } +} diff --git a/x/fundraising/types/tx.pb.go b/x/fundraising/types/tx.pb.go index e7ac061f..b06de44a 100644 --- a/x/fundraising/types/tx.pb.go +++ b/x/fundraising/types/tx.pb.go @@ -389,6 +389,85 @@ func (m *MsgPlaceBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceBidResponse proto.InternalMessageInfo +// MsgAddAllowedBidder defines a SDK message for adding an allowed bidder to the +// auction. +type MsgAddAllowedBidder struct { + // auction_id specifies the auction id + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // allowed_bidder specifies the bidder who is allowed to bid and their maximum + // bid amount + AllowedBidder AllowedBidder `protobuf:"bytes,2,opt,name=allowed_bidder,json=allowedBidder,proto3" json:"allowed_bidder"` +} + +func (m *MsgAddAllowedBidder) Reset() { *m = MsgAddAllowedBidder{} } +func (m *MsgAddAllowedBidder) String() string { return proto.CompactTextString(m) } +func (*MsgAddAllowedBidder) ProtoMessage() {} +func (*MsgAddAllowedBidder) Descriptor() ([]byte, []int) { + return fileDescriptor_f041af45fa02962b, []int{8} +} +func (m *MsgAddAllowedBidder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddAllowedBidder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddAllowedBidder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddAllowedBidder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddAllowedBidder.Merge(m, src) +} +func (m *MsgAddAllowedBidder) XXX_Size() int { + return m.Size() +} +func (m *MsgAddAllowedBidder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddAllowedBidder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddAllowedBidder proto.InternalMessageInfo + +type MsgAddAllowedBidderResponse struct { +} + +func (m *MsgAddAllowedBidderResponse) Reset() { *m = MsgAddAllowedBidderResponse{} } +func (m *MsgAddAllowedBidderResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddAllowedBidderResponse) ProtoMessage() {} +func (*MsgAddAllowedBidderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f041af45fa02962b, []int{9} +} +func (m *MsgAddAllowedBidderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddAllowedBidderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddAllowedBidderResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddAllowedBidderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddAllowedBidderResponse.Merge(m, src) +} +func (m *MsgAddAllowedBidderResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddAllowedBidderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddAllowedBidderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddAllowedBidderResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateFixedPriceAuction)(nil), "tendermint.fundraising.MsgCreateFixedPriceAuction") proto.RegisterType((*MsgCreateFixedPriceAuctionResponse)(nil), "tendermint.fundraising.MsgCreateFixedPriceAuctionResponse") @@ -398,59 +477,65 @@ func init() { proto.RegisterType((*MsgCancelAuctionResponse)(nil), "tendermint.fundraising.MsgCancelAuctionResponse") proto.RegisterType((*MsgPlaceBid)(nil), "tendermint.fundraising.MsgPlaceBid") proto.RegisterType((*MsgPlaceBidResponse)(nil), "tendermint.fundraising.MsgPlaceBidResponse") + proto.RegisterType((*MsgAddAllowedBidder)(nil), "tendermint.fundraising.MsgAddAllowedBidder") + proto.RegisterType((*MsgAddAllowedBidderResponse)(nil), "tendermint.fundraising.MsgAddAllowedBidderResponse") } func init() { proto.RegisterFile("fundraising/tx.proto", fileDescriptor_f041af45fa02962b) } var fileDescriptor_f041af45fa02962b = []byte{ - // 745 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x41, 0x4f, 0x13, 0x4d, - 0x18, 0xee, 0x7e, 0x2d, 0xa5, 0x9d, 0x7e, 0x06, 0x58, 0x11, 0xea, 0x26, 0x6c, 0xb1, 0x1a, 0x69, - 0x34, 0xee, 0x4a, 0x8d, 0x31, 0xe1, 0x62, 0x2c, 0x68, 0xe2, 0x81, 0x40, 0x56, 0xa3, 0x09, 0x31, - 0x36, 0xdb, 0x9d, 0x97, 0x65, 0x42, 0x77, 0xa6, 0xd9, 0x99, 0x92, 0x72, 0xf3, 0xa8, 0x37, 0x7e, - 0x82, 0x67, 0x7f, 0x82, 0xbf, 0x80, 0x23, 0x47, 0xe3, 0x01, 0x0c, 0xfc, 0x01, 0x7f, 0x82, 0x99, - 0x9d, 0x6d, 0xdd, 0x36, 0x14, 0x4b, 0x35, 0x9e, 0x3c, 0x75, 0xe6, 0x9d, 0xe7, 0x79, 0xde, 0x99, - 0xf7, 0x7d, 0x66, 0xba, 0x68, 0x76, 0xbb, 0x4d, 0x71, 0xe8, 0x12, 0x4e, 0xa8, 0x6f, 0x8b, 0x8e, - 0xd5, 0x0a, 0x99, 0x60, 0xfa, 0x9c, 0x00, 0x8a, 0x21, 0x0c, 0x08, 0x15, 0x56, 0x02, 0x60, 0x98, - 0x1e, 0xe3, 0x01, 0xe3, 0x76, 0xc3, 0xe5, 0x60, 0xef, 0x2d, 0x37, 0x40, 0xb8, 0xcb, 0xb6, 0xc7, - 0x08, 0x55, 0x3c, 0x63, 0xd6, 0x67, 0x3e, 0x8b, 0x86, 0xb6, 0x1c, 0xc5, 0xd1, 0x92, 0xcf, 0x98, - 0xdf, 0x04, 0x3b, 0x9a, 0x35, 0xda, 0xdb, 0xb6, 0x20, 0x01, 0x70, 0xe1, 0x06, 0xad, 0x18, 0xb0, - 0x90, 0xdc, 0x44, 0x62, 0xac, 0x96, 0xcb, 0x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0x00, 0x0f, 0x7e, 0x04, 0x00, 0x00, 0xff, - 0xff, 0xd6, 0x18, 0x48, 0x07, 0x77, 0x09, 0x00, 0x00, + // 811 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f, 0x4f, 0x13, 0x4d, + 0x18, 0xef, 0xbe, 0x5d, 0x4a, 0x3b, 0x7d, 0x79, 0x81, 0x7d, 0x11, 0xea, 0x1a, 0xb6, 0x58, 0xff, + 0xd0, 0x68, 0xdc, 0x95, 0x12, 0x63, 0xc2, 0xc5, 0xb0, 0xa0, 0x89, 0x07, 0x02, 0x59, 0x8d, 0x26, + 0xc4, 0xb8, 0xd9, 0xee, 0x0c, 0xcb, 0x84, 0xfd, 0xd3, 0xec, 0x4c, 0xb1, 0xdc, 0x3c, 0xea, 0xc5, + 0xf0, 0x11, 0x3c, 0xfb, 0x11, 0xfc, 0x04, 0x1c, 0xb9, 0x98, 0x18, 0x0f, 0x60, 0xe0, 0x0b, 0xf8, + 0x11, 0xcc, 0xec, 0x6c, 0xd7, 0x6d, 0xa5, 0xd0, 0x56, 0xe3, 0xc9, 0x13, 0x33, 0xcf, 0xfc, 0x9e, + 0xdf, 0xf3, 0xef, 0xf7, 0x2c, 0x05, 0x53, 0x5b, 0x4d, 0x1f, 0x86, 0x16, 0x26, 0xd8, 0x77, 0x34, + 0xda, 0x52, 0x1b, 0x61, 0x40, 0x03, 0x69, 0x9a, 0x22, 0x1f, 0xa2, 0xd0, 0xc3, 0x3e, 0x55, 0x53, + 0x00, 0x59, 0xb1, 0x03, 0xe2, 0x05, 0x44, 0xab, 0x5b, 0x04, 0x69, 0xbb, 0x0b, 0x75, 0x44, 0xad, + 0x05, 0xcd, 0x0e, 0xb0, 0xcf, 0xfd, 0xe4, 0x29, 0x27, 0x70, 0x82, 0xe8, 0xa8, 0xb1, 0x53, 0x6c, + 0x2d, 0x3b, 0x41, 0xe0, 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x63, 0x4a, 0x23, 0xe5, 0xbb, 0xfd, 0x22, + 0x93, 0x60, 0x2f, 0x40, 0x3e, 0xd9, 0x9c, 0x6b, 0xe7, 0x78, 0xb7, 0x41, 0xf2, 0xed, 0x3e, 0x40, + 0x09, 0x3b, 0x05, 0x13, 0x3f, 0xa9, 0xf1, 0x3c, 0x82, 0x6e, 0xb0, 0xbc, 0x38, 0x00, 0xb8, 0x1d, + 0x55, 0x5f, 0x3f, 0x38, 0x51, 0x84, 0xc3, 0x13, 0x45, 0xf8, 0x7a, 0xa2, 0x08, 0xfb, 0xa7, 0x4a, + 0xe6, 0xf0, 0x54, 0xc9, 0x7c, 0x3e, 0x55, 0x32, 0x9b, 0xf7, 0x52, 0xdb, 0xf6, 0x83, 0x38, 0xfd, + 0x13, 0x4f, 0x6b, 0x75, 0xdc, 0xa2, 0x05, 0xac, 0xe7, 0xa2, 0xef, 0xe4, 0xe2, 0xf7, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x5c, 0x3f, 0x3e, 0x93, 0x9d, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -465,15 +550,18 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // this line is used by starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + // CreateFixedPriceAuction defines a method to create a FixedPrice auction + // message. CreateFixedPriceAuction(ctx context.Context, in *MsgCreateFixedPriceAuction, opts ...grpc.CallOption) (*MsgCreateFixedPriceAuctionResponse, error) - // Submit a create english auction message. + // CreateEnglishAuction defines a method to create an English auction message CreateEnglishAuction(ctx context.Context, in *MsgCreateEnglishAuction, opts ...grpc.CallOption) (*MsgCreateEnglishAuctionResponse, error) - // Submit a cancel auction message. + // CancelAuction defines a method to cancel the auction message. CancelAuction(ctx context.Context, in *MsgCancelAuction, opts ...grpc.CallOption) (*MsgCancelAuctionResponse, error) - // Submit a PlaceBid message to the certain fundraising. + // PlaceBid defines a method to place a bid message. PlaceBid(ctx context.Context, in *MsgPlaceBid, opts ...grpc.CallOption) (*MsgPlaceBidResponse, error) + // AddAllowedBidder defines a method sto add a single allowed bidder message. + // This is for the testing purpose and it must not be used in mainnet. + AddAllowedBidder(ctx context.Context, in *MsgAddAllowedBidder, opts ...grpc.CallOption) (*MsgAddAllowedBidderResponse, error) } type msgClient struct { @@ -520,17 +608,29 @@ func (c *msgClient) PlaceBid(ctx context.Context, in *MsgPlaceBid, opts ...grpc. return out, nil } +func (c *msgClient) AddAllowedBidder(ctx context.Context, in *MsgAddAllowedBidder, opts ...grpc.CallOption) (*MsgAddAllowedBidderResponse, error) { + out := new(MsgAddAllowedBidderResponse) + err := c.cc.Invoke(ctx, "/tendermint.fundraising.Msg/AddAllowedBidder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { - // this line is used by starport scaffolding # proto/tx/rpc - // Submit a create fixed price auction message. + // CreateFixedPriceAuction defines a method to create a FixedPrice auction + // message. CreateFixedPriceAuction(context.Context, *MsgCreateFixedPriceAuction) (*MsgCreateFixedPriceAuctionResponse, error) - // Submit a create english auction message. + // CreateEnglishAuction defines a method to create an English auction message CreateEnglishAuction(context.Context, *MsgCreateEnglishAuction) (*MsgCreateEnglishAuctionResponse, error) - // Submit a cancel auction message. + // CancelAuction defines a method to cancel the auction message. CancelAuction(context.Context, *MsgCancelAuction) (*MsgCancelAuctionResponse, error) - // Submit a PlaceBid message to the certain fundraising. + // PlaceBid defines a method to place a bid message. PlaceBid(context.Context, *MsgPlaceBid) (*MsgPlaceBidResponse, error) + // AddAllowedBidder defines a method sto add a single allowed bidder message. + // This is for the testing purpose and it must not be used in mainnet. + AddAllowedBidder(context.Context, *MsgAddAllowedBidder) (*MsgAddAllowedBidderResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -549,6 +649,9 @@ func (*UnimplementedMsgServer) CancelAuction(ctx context.Context, req *MsgCancel func (*UnimplementedMsgServer) PlaceBid(ctx context.Context, req *MsgPlaceBid) (*MsgPlaceBidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PlaceBid not implemented") } +func (*UnimplementedMsgServer) AddAllowedBidder(ctx context.Context, req *MsgAddAllowedBidder) (*MsgAddAllowedBidderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddAllowedBidder not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -626,6 +729,24 @@ func _Msg_PlaceBid_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Msg_AddAllowedBidder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddAllowedBidder) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddAllowedBidder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tendermint.fundraising.Msg/AddAllowedBidder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddAllowedBidder(ctx, req.(*MsgAddAllowedBidder)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "tendermint.fundraising.Msg", HandlerType: (*MsgServer)(nil), @@ -646,6 +767,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "PlaceBid", Handler: _Msg_PlaceBid_Handler, }, + { + MethodName: "AddAllowedBidder", + Handler: _Msg_AddAllowedBidder_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "fundraising/tx.proto", @@ -1027,6 +1152,67 @@ func (m *MsgPlaceBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAddAllowedBidder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddAllowedBidder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddAllowedBidder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AllowedBidder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgAddAllowedBidderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddAllowedBidderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddAllowedBidderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1176,6 +1362,29 @@ func (m *MsgPlaceBidResponse) Size() (n int) { return n } +func (m *MsgAddAllowedBidder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = m.AllowedBidder.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgAddAllowedBidderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2281,6 +2490,158 @@ func (m *MsgPlaceBidResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAddAllowedBidder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddAllowedBidder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddAllowedBidder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedBidder", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AllowedBidder.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddAllowedBidderResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddAllowedBidderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddAllowedBidderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0