Add CreatedAt info to ContractInfo

This commit is contained in:
Ethan Frey 2020-02-27 17:55:58 +01:00
parent 54b0468dc7
commit c72cc4596e
1 changed files with 10 additions and 0 deletions

View File

@ -45,6 +45,16 @@ type ContractInfo struct {
Creator sdk.AccAddress `json:"creator"`
Label string `json:"label"`
InitMsg json.RawMessage `json:"init_msg"`
// never show this in query results, just use for sorting
Created CreatedAt `json:"-"`
}
// CreatedAt can be used to sort contracts
type CreatedAt struct {
// BlockHeight is the block the contract was created at
BlockHeight int64
// TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed)
TxIndex uint64
}
// NewParams initializes params for a contract instance