Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
d4c38318
Commit
d4c38318
authored
Jan 02, 2020
by
pengjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/jpeng-go/plugin
parents
f302a0e2
af0948e2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
24 deletions
+21
-24
cmd.go
plugin/dapp/collateralize/commands/cmd.go
+1
-1
collateralizedb.go
plugin/dapp/collateralize/executor/collateralizedb.go
+8
-9
query.go
plugin/dapp/collateralize/executor/query.go
+1
-1
collateralize.pb.go
plugin/dapp/collateralize/types/collateralize.pb.go
+0
-0
cmd.go
plugin/dapp/issuance/commands/cmd.go
+1
-1
issuance_test.go
plugin/dapp/issuance/executor/issuance_test.go
+1
-1
issuancedb.go
plugin/dapp/issuance/executor/issuancedb.go
+7
-8
query.go
plugin/dapp/issuance/executor/query.go
+2
-3
issuance.pb.go
plugin/dapp/issuance/types/issuance.pb.go
+0
-0
No files found.
plugin/dapp/collateralize/commands/cmd.go
View file @
d4c38318
...
...
@@ -383,7 +383,7 @@ func CollateralizeQueryUserBalance(cmd *cobra.Command, args []string) {
params
.
Execer
=
pkt
.
CollateralizeX
params
.
FuncName
=
"CollateralizeUserBalance"
req
:=
&
pkt
.
ReqCollateralizeRecordByAddr
{
Addr
:
addr
,
Addr
:
addr
,
}
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
...
...
plugin/dapp/collateralize/executor/collateralizedb.go
View file @
d4c38318
...
...
@@ -19,10 +19,10 @@ import (
// List control
const
(
ListDESC
=
int32
(
0
)
// list降序
ListASC
=
int32
(
1
)
// list升序
ListDESC
=
int32
(
0
)
// list降序
ListASC
=
int32
(
1
)
// list升序
DefaultCount
=
int32
(
20
)
// 默认一次取多少条记录
MaxCount
=
int32
(
100
)
// 最多取100条
MaxCount
=
int32
(
100
)
// 最多取100条
)
const
(
...
...
@@ -1338,8 +1338,8 @@ func queryCollateralizeUserBalanceStatus(db dbm.KV, localdb dbm.KVDB, addr strin
query
:=
pty
.
NewRecordTable
(
localdb
)
.
GetQuery
(
localdb
)
var
primary
[]
byte
var
data
=
&
pty
.
ReceiptCollateralize
{
AccountAddr
:
addr
,
Status
:
status
,
AccountAddr
:
addr
,
Status
:
status
,
}
var
rows
[]
*
table
.
Row
...
...
@@ -1367,7 +1367,7 @@ func queryCollateralizeUserBalanceStatus(db dbm.KV, localdb dbm.KVDB, addr strin
primary
=
[]
byte
(
rows
[
DefaultCount
-
1
]
.
Data
.
(
*
pty
.
ReceiptCollateralize
)
.
RecordId
)
}
return
totalBalance
,
nil
return
totalBalance
,
nil
}
func
queryCollateralizeUserBalance
(
db
dbm
.
KV
,
localdb
dbm
.
KVDB
,
addr
string
)
(
int64
,
error
)
{
...
...
@@ -1378,7 +1378,7 @@ func queryCollateralizeUserBalance(db dbm.KV, localdb dbm.KVDB, addr string) (in
clog
.
Error
(
"queryCollateralizeUserBalance"
,
"err"
,
err
)
}
else
{
totalBalance
+=
balance
}
}
balance
,
err
=
queryCollateralizeUserBalanceStatus
(
db
,
localdb
,
addr
,
pty
.
CollateralizeUserStatusWarning
)
if
err
!=
nil
{
...
...
@@ -1395,4 +1395,4 @@ func queryCollateralizeUserBalance(db dbm.KV, localdb dbm.KVDB, addr string) (in
}
return
totalBalance
,
nil
}
\ No newline at end of file
}
plugin/dapp/collateralize/executor/query.go
View file @
d4c38318
...
...
@@ -175,5 +175,5 @@ func (c *Collateralize) Query_CollateralizeUserBalance(req *pty.ReqCollateralize
return
nil
,
err
}
return
&
pty
.
RepCollateralizeUserBalance
{
Balance
:
balance
},
nil
return
&
pty
.
RepCollateralizeUserBalance
{
Balance
:
balance
},
nil
}
plugin/dapp/collateralize/types/collateralize.pb.go
View file @
d4c38318
This diff is collapsed.
Click to expand it.
plugin/dapp/issuance/commands/cmd.go
View file @
d4c38318
...
...
@@ -314,7 +314,7 @@ func IssuanceQueryUserBalance(cmd *cobra.Command, args []string) {
params
.
Execer
=
pkt
.
IssuanceX
params
.
FuncName
=
"IssuanceUserBalance"
req
:=
&
pkt
.
ReqIssuanceRecords
{
Addr
:
addr
,
Addr
:
addr
,
}
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
...
...
plugin/dapp/issuance/executor/issuance_test.go
View file @
d4c38318
...
...
@@ -295,7 +295,7 @@ func TestIssuance(t *testing.T) {
res
,
err
=
exec
.
Query
(
"IssuanceUserBalance"
,
types
.
Encode
(
&
pkt
.
ReqIssuanceRecords
{
Addr
:
string
(
Nodes
[
1
]),
Status
:
1
}))
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
100
*
types
.
Coin
,
res
.
(
*
pkt
.
RepIssuanceUserBalance
)
.
Balance
)
assert
.
Equal
(
t
,
100
*
types
.
Coin
,
res
.
(
*
pkt
.
RepIssuanceUserBalance
)
.
Balance
)
// issuance repay
p5
:=
&
pkt
.
IssuanceRepayTx
{
...
...
plugin/dapp/issuance/executor/issuancedb.go
View file @
d4c38318
...
...
@@ -17,10 +17,10 @@ import (
// List control
const
(
ListDESC
=
int32
(
0
)
// list降序
ListASC
=
int32
(
1
)
// list升序
ListDESC
=
int32
(
0
)
// list降序
ListASC
=
int32
(
1
)
// list升序
DefaultCount
=
int32
(
20
)
// 默认一次取多少条记录
MaxCount
=
int32
(
100
)
// 最多取100条
MaxCount
=
int32
(
100
)
// 最多取100条
)
const
(
...
...
@@ -1087,8 +1087,8 @@ func queryIssuanceUserBalanceStatus(db dbm.KV, localdb dbm.KVDB, addr string, st
query
:=
pty
.
NewRecordTable
(
localdb
)
.
GetQuery
(
localdb
)
var
primary
[]
byte
var
data
=
&
pty
.
ReceiptIssuance
{
AccountAddr
:
addr
,
Status
:
status
,
AccountAddr
:
addr
,
Status
:
status
,
}
var
rows
[]
*
table
.
Row
...
...
@@ -1116,7 +1116,7 @@ func queryIssuanceUserBalanceStatus(db dbm.KV, localdb dbm.KVDB, addr string, st
primary
=
[]
byte
(
rows
[
DefaultCount
-
1
]
.
Data
.
(
*
pty
.
ReceiptIssuance
)
.
DebtId
)
}
return
totalBalance
,
nil
return
totalBalance
,
nil
}
func
queryIssuanceUserBalance
(
db
dbm
.
KV
,
localdb
dbm
.
KVDB
,
addr
string
)
(
int64
,
error
)
{
...
...
@@ -1144,4 +1144,4 @@ func queryIssuanceUserBalance(db dbm.KV, localdb dbm.KVDB, addr string) (int64,
}
return
totalBalance
,
nil
}
\ No newline at end of file
}
plugin/dapp/issuance/executor/query.go
View file @
d4c38318
...
...
@@ -130,5 +130,5 @@ func (c *Issuance) Query_IssuanceUserBalance(req *pty.ReqIssuanceRecords) (types
return
nil
,
err
}
return
&
pty
.
RepIssuanceUserBalance
{
Balance
:
balance
},
nil
}
\ No newline at end of file
return
&
pty
.
RepIssuanceUserBalance
{
Balance
:
balance
},
nil
}
plugin/dapp/issuance/types/issuance.pb.go
View file @
d4c38318
This diff is collapsed.
Click to expand it.
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