Commit 90a0f025 authored by szh's avatar szh

add hash

parent 7a46a9f3
......@@ -10,6 +10,7 @@ import (
"github.com/33cn/chain33/types"
ttype "github.com/33cn/plugin/plugin/dapp/ticket/types"
"github.com/jinzhu/gorm"
"github.com/33cn/chain33/common"
)
func Setup() {
......@@ -180,6 +181,7 @@ func DealBlock(height int64) ( []*models.RaspMinerStat, *models.RaspMinerTxs,er
if rt1 != nil && rt1.Miner != ""{
rt.Miner = rt1.Miner
rt.Amount = rt1.Amount
rt.Hash = rt1.Hash
}
if rs1 != nil && rs1.Addr != "" {
rs := &RMinerStat{}
......@@ -233,6 +235,7 @@ type RMinerTxs struct {
ReturnAddr string `json:"return_addr"`
Amount int64 `json:"amount"`
Height int64 `json:"height"`
Hash string `json:"hash"`
Time int64 `json:"time"`
}
......@@ -264,6 +267,7 @@ func dealTx(tx *types.Transaction) (*RMinerTxs,*RMinerStat,error) {
case ttype.TicketActionMiner:
rt.Amount = miner.GetMiner().Reward
rt.Miner = tx.From()
rt.Hash = common.ToHex(tx.Hash())
rs.MinedAmount = miner.GetMiner().Reward
rs.MinedTicketCount = int64(1)
rs.Addr = tx.From()
......@@ -299,6 +303,7 @@ func NewMinerTxs(rt *RMinerTxs) *models.RaspMinerTxs {
r.Height = rt.Height
r.Amount = rt.Amount
r.Miner = rt.Miner
r.Hash = rt.Hash
return &r
}
......
......@@ -47,8 +47,8 @@ func GetTicketInfo(c *gin.Context) {
if req.Page == 0 {
req.Page = int32(1)
}
if req.Pageszie == 0 {
req.Pageszie = int32(10)
if req.Pagesize == 0 {
req.Pagesize = int32(10)
}
}
var pai pai_service.Pai
......
......@@ -50,7 +50,7 @@ type MinedTxInfo struct {
type ReqTicketInfo struct {
Addr string `json:"addr" validate:"requried"`
Page int32 `json:"page"`
Pageszie int32 `json:"pageszie"`
Pagesize int32 `json:"pagesize"`
Detail bool `json:"detail"`
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment