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
e72871eb
Commit
e72871eb
authored
Nov 13, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#627 fix frozen value transfer
parent
bb1aa4b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
collateralizedb.go
plugin/dapp/collateralize/executor/collateralizedb.go
+10
-1
issuancedb.go
plugin/dapp/issuance/executor/issuancedb.go
+10
-1
No files found.
plugin/dapp/collateralize/executor/collateralizedb.go
View file @
e72871eb
...
...
@@ -575,7 +575,7 @@ func (action *Action) CollateralizeBorrow(borrow *pty.CollateralizeBorrow) (*typ
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 借出ccny
receipt
,
err
=
action
.
tokenAccount
.
ExecTransfer
(
coll
.
CreateAddr
,
action
.
fromaddr
,
action
.
execaddr
,
borrow
.
Value
*
Coin
)
receipt
,
err
=
action
.
tokenAccount
.
ExecTransfer
Frozen
(
coll
.
CreateAddr
,
action
.
fromaddr
,
action
.
execaddr
,
borrow
.
Value
*
Coin
)
if
err
!=
nil
{
clog
.
Error
(
"CollateralizeBorrow.ExecTokenTransfer"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
borrow
.
Value
)
return
nil
,
err
...
...
@@ -672,6 +672,15 @@ func (action *Action) CollateralizeRepay(repay *pty.CollateralizeRepay) (*types.
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// ccny冻结
receipt
,
err
=
action
.
tokenAccount
.
ExecFrozen
(
coll
.
CreateAddr
,
action
.
execaddr
,
realRepay
*
Coin
)
if
err
!=
nil
{
clog
.
Error
(
"CollateralizeCreate.Frozen"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
realRepay
)
return
nil
,
err
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 抵押物归还
receipt
,
err
=
action
.
coinsAccount
.
ExecTransferFrozen
(
coll
.
CreateAddr
,
action
.
fromaddr
,
action
.
execaddr
,
borrowRecord
.
CollateralValue
*
Coin
)
if
err
!=
nil
{
...
...
plugin/dapp/issuance/executor/issuancedb.go
View file @
e72871eb
...
...
@@ -582,7 +582,7 @@ func (action *Action) IssuanceDebt(debt *pty.IssuanceDebt) (*types.Receipt, erro
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 借出ccny
receipt
,
err
=
action
.
tokenAccount
.
ExecTransfer
(
issu
.
IssuerAddr
,
action
.
fromaddr
,
action
.
execaddr
,
debt
.
Value
*
Coin
)
receipt
,
err
=
action
.
tokenAccount
.
ExecTransfer
Frozen
(
issu
.
IssuerAddr
,
action
.
fromaddr
,
action
.
execaddr
,
debt
.
Value
*
Coin
)
if
err
!=
nil
{
clog
.
Error
(
"IssuanceDebt.ExecTokenTransfer"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
debt
.
Value
)
return
nil
,
err
...
...
@@ -676,6 +676,15 @@ func (action *Action) IssuanceRepay(repay *pty.IssuanceRepay) (*types.Receipt, e
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 冻结ccny
receipt
,
err
=
action
.
tokenAccount
.
ExecFrozen
(
issu
.
IssuerAddr
,
action
.
execaddr
,
debtRecord
.
DebtValue
*
Coin
)
if
err
!=
nil
{
clog
.
Error
(
"IssuanceCreate.Frozen"
,
"addr"
,
action
.
fromaddr
,
"execaddr"
,
action
.
execaddr
,
"amount"
,
debtRecord
.
DebtValue
)
return
nil
,
err
}
logs
=
append
(
logs
,
receipt
.
Logs
...
)
kv
=
append
(
kv
,
receipt
.
KV
...
)
// 抵押物归还
receipt
,
err
=
action
.
coinsAccount
.
ExecTransferFrozen
(
issu
.
IssuerAddr
,
action
.
fromaddr
,
action
.
execaddr
,
debtRecord
.
CollateralValue
*
Coin
)
if
err
!=
nil
{
...
...
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