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
29817135
Commit
29817135
authored
Feb 07, 2020
by
pengjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/jpeng-go/plugin
parents
238360b5
aba0602a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
3 deletions
+2
-3
collateralize_test.go
plugin/dapp/collateralize/executor/collateralize_test.go
+0
-1
collateralizedb.go
plugin/dapp/collateralize/executor/collateralizedb.go
+1
-1
issuancedb.go
plugin/dapp/issuance/executor/issuancedb.go
+1
-1
No files found.
plugin/dapp/collateralize/executor/collateralize_test.go
View file @
29817135
...
...
@@ -586,7 +586,6 @@ func TestCollateralize(t *testing.T) {
types
.
Encode
(
&
pkt
.
ReqCollateralizeRecordByStatus
{
CollateralizeId
:
common
.
ToHex
(
collateralizeID
),
Status
:
4
}))
assert
.
Nil
(
t
,
res
)
// expire liquidate
p10
:=
&
pkt
.
CollateralizeBorrowTx
{
CollateralizeID
:
common
.
ToHex
(
collateralizeID
),
...
...
plugin/dapp/collateralize/executor/collateralizedb.go
View file @
29817135
...
...
@@ -548,7 +548,7 @@ func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*typ
// 借贷金额不超过个人限额
userBalance
,
_
:=
queryCollateralizeUserBalance
(
action
.
db
,
action
.
localDB
,
action
.
fromaddr
)
if
borrow
.
GetValue
()
+
userBalance
>
coll
.
DebtCeiling
{
if
borrow
.
GetValue
()
+
userBalance
>
coll
.
DebtCeiling
{
clog
.
Error
(
"CollateralizeBorrow"
,
"CollID"
,
coll
.
CollateralizeId
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"borrow value"
,
borrow
.
GetValue
(),
"current balance"
,
userBalance
,
"error"
,
pty
.
ErrCollateralizeExceedDebtCeiling
)
return
nil
,
pty
.
ErrCollateralizeExceedDebtCeiling
...
...
plugin/dapp/issuance/executor/issuancedb.go
View file @
29817135
...
...
@@ -515,7 +515,7 @@ func (action *Action) IssuanceDebt(debt *pty.IssuanceDebt) (*types.Receipt, erro
// 借贷金额不超过个人限额
userBalance
,
_
:=
queryIssuanceUserBalance
(
action
.
db
,
action
.
localDB
,
action
.
fromaddr
)
if
debt
.
GetValue
()
+
userBalance
>
issu
.
DebtCeiling
{
if
debt
.
GetValue
()
+
userBalance
>
issu
.
DebtCeiling
{
clog
.
Error
(
"IssuanceDebt"
,
"CollID"
,
issu
.
IssuanceId
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"debt value"
,
debt
.
GetValue
(),
"current balance"
,
userBalance
,
"error"
,
pty
.
ErrIssuanceExceedDebtCeiling
)
return
nil
,
pty
.
ErrIssuanceExceedDebtCeiling
...
...
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