add json/yaml to msgs (#323)

* added json/yaml to MsgPostPrice, MsgPlaceBid

* Added sdk.Msg to ensure Msg interface compliance at compile time
This commit is contained in:
Denali Marsh 2020-01-21 13:40:04 -08:00 committed by GitHub
parent bab798f50d
commit ab72433db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,13 +11,16 @@ const (
TypeMsgPostPrice = "post_price" TypeMsgPostPrice = "post_price"
) )
// ensure Msg interface compliance at compile time
var _ sdk.Msg = &MsgPostPrice{}
// MsgPostPrice struct representing a posted price message. // MsgPostPrice struct representing a posted price message.
// Used by oracles to input prices to the pricefeed // Used by oracles to input prices to the pricefeed
type MsgPostPrice struct { type MsgPostPrice struct {
From sdk.AccAddress // client that sent in this address From sdk.AccAddress `json:"from" yaml:"from"` // client that sent in this address
MarketID string // asset code used by exchanges/api MarketID string `json:"market_id" yaml:"market_id"` // asset code used by exchanges/api
Price sdk.Dec // price in decimal (max precision 18) Price sdk.Dec `json:"price" yaml:"price"` // price in decimal (max precision 18)
Expiry time.Time // expiry time Expiry time.Time `json:"expiry" yaml:"expiry"` // expiry time
} }
// NewMsgPostPrice creates a new post price msg // NewMsgPostPrice creates a new post price msg