remove unused message types

This commit is contained in:
rhuairahrighairigh 2020-01-06 16:35:50 +00:00
parent 983de010df
commit b2fa8d81ee
2 changed files with 6 additions and 43 deletions

View File

@ -9,7 +9,7 @@ type GenesisAuctions []Auction
// GenesisState - auction state that must be provided at genesis // GenesisState - auction state that must be provided at genesis
type GenesisState struct { type GenesisState struct {
NextAuctionID uint64 `json:"next_auction_id" yaml:"next_auction_id"` NextAuctionID uint64 `json:"next_auction_id" yaml:"next_auction_id"`
AuctionParams AuctionParams `json:"auction_params" yaml:"auction_params"` AuctionParams AuctionParams `json:"auction_params" yaml:"auction_params"`
Auctions GenesisAuctions `json:"genesis_auctions" yaml:"genesis_auctions"` Auctions GenesisAuctions `json:"genesis_auctions" yaml:"genesis_auctions"`
} }

View File

@ -2,6 +2,9 @@ package types
import sdk "github.com/cosmos/cosmos-sdk/types" import sdk "github.com/cosmos/cosmos-sdk/types"
// ensure Msg interface compliance at compile time
var _ sdk.Msg = &MsgPlaceBid{}
// MsgPlaceBid is the message type used to place a bid on any type of auction. // MsgPlaceBid is the message type used to place a bid on any type of auction.
type MsgPlaceBid struct { type MsgPlaceBid struct {
AuctionID uint64 AuctionID uint64
@ -21,7 +24,7 @@ func NewMsgPlaceBid(auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, lot s
} }
// Route return the message type used for routing the message. // Route return the message type used for routing the message.
func (msg MsgPlaceBid) Route() string { return "auction" } func (msg MsgPlaceBid) Route() string { return RouterKey }
// Type returns a human-readable string for the message, intended for utilization within tags. // Type returns a human-readable string for the message, intended for utilization within tags.
func (msg MsgPlaceBid) Type() string { return "place_bid" } func (msg MsgPlaceBid) Type() string { return "place_bid" }
@ -51,43 +54,3 @@ func (msg MsgPlaceBid) GetSignBytes() []byte {
func (msg MsgPlaceBid) GetSigners() []sdk.AccAddress { func (msg MsgPlaceBid) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.Bidder} return []sdk.AccAddress{msg.Bidder}
} }
// The CDP system doesn't need Msgs for starting auctions. But they could be added to allow people to create random auctions of their own, and to make this module more general purpose.
// type MsgStartForwardAuction struct {
// Seller sdk.AccAddress
// Amount sdk.Coins
// // TODO add starting bid amount?
// // TODO specify asset denom to be received
// }
// // NewMsgStartAuction returns a new MsgStartAuction.
// func NewMsgStartAuction(seller sdk.AccAddress, amount sdk.Coins, maxBid sdk.Coins) MsgStartAuction {
// return MsgStartAuction{
// Seller: seller,
// Amount: amount,
// MaxBid: maxBid,
// }
// }
// // Route return the message type used for routing the message.
// func (msg MsgStartAuction) Route() string { return "auction" }
// // Type returns a human-readable string for the message, intended for utilization within tags.
// func (msg MsgStartAuction) Type() string { return "start_auction" }
// // ValidateBasic does a simple validation check that doesn't require access to any other information.
// func (msg MsgStartAuction) ValidateBasic() sdk.Error {
// return nil
// }
// // GetSignBytes gets the canonical byte representation of the Msg.
// func (msg MsgStartAuction) GetSignBytes() []byte {
// bz := msgCdc.MustMarshalJSON(msg)
// return sdk.MustSortJSON(bz)
// }
// // GetSigners returns the addresses of signers that must sign.
// func (msg MsgStartAuction) GetSigners() []sdk.AccAddress {
// return []sdk.AccAddress{msg.Seller}
// }