Commit 90a0f025 authored by szh's avatar szh

add hash

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