Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligaishun
chain33-pai
Commits
90a0f025
Commit
90a0f025
authored
Oct 16, 2019
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hash
parent
7a46a9f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
miner.go
miner/miner.go
+5
-0
pai.go
routers/api/v1/pai.go
+2
-2
pai.go
service/pai_service/pai.go
+1
-1
No files found.
miner/miner.go
View file @
90a0f025
...
...
@@ -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
}
...
...
routers/api/v1/pai.go
View file @
90a0f025
...
...
@@ -47,8 +47,8 @@ func GetTicketInfo(c *gin.Context) {
if
req
.
Page
==
0
{
req
.
Page
=
int32
(
1
)
}
if
req
.
Pages
zi
e
==
0
{
req
.
Pages
zi
e
=
int32
(
10
)
if
req
.
Pages
iz
e
==
0
{
req
.
Pages
iz
e
=
int32
(
10
)
}
}
var
pai
pai_service
.
Pai
...
...
service/pai_service/pai.go
View file @
90a0f025
...
...
@@ -50,7 +50,7 @@ type MinedTxInfo struct {
type
ReqTicketInfo
struct
{
Addr
string
`json:"addr" validate:"requried"`
Page
int32
`json:"page"`
Pages
zie
int32
`json:"pageszi
e"`
Pages
ize
int32
`json:"pagesiz
e"`
Detail
bool
`json:"detail"`
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment