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
159fd053
Commit
159fd053
authored
Jan 22, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix & add log to debug
parent
4c4f6066
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
local_order.go
plugin/dapp/trade/executor/local_order.go
+10
-5
No files found.
plugin/dapp/trade/executor/local_order.go
View file @
159fd053
...
@@ -73,7 +73,7 @@ func NewOrderRow() *OrderRow {
...
@@ -73,7 +73,7 @@ func NewOrderRow() *OrderRow {
// CreateRow create row
// CreateRow create row
func
(
r
*
OrderRow
)
CreateRow
()
*
table
.
Row
{
func
(
r
*
OrderRow
)
CreateRow
()
*
table
.
Row
{
return
&
table
.
Row
{
Data
:
&
pty
.
ReplyTrade
Order
{}}
return
&
table
.
Row
{
Data
:
&
pty
.
Local
Order
{}}
}
}
// SetPayload set payload
// SetPayload set payload
...
@@ -177,6 +177,7 @@ func (t *trade) genSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase,
...
@@ -177,6 +177,7 @@ func (t *trade) genSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase,
order
:=
&
pty
.
LocalOrder
{
order
:=
&
pty
.
LocalOrder
{
AssetSymbol
:
sellorder
.
TokenSymbol
,
AssetSymbol
:
sellorder
.
TokenSymbol
,
TxIndex
:
txIndex
,
Owner
:
sellorder
.
Address
,
Owner
:
sellorder
.
Address
,
AmountPerBoardlot
:
sellorder
.
AmountPerBoardlot
,
AmountPerBoardlot
:
sellorder
.
AmountPerBoardlot
,
MinBoardlot
:
sellorder
.
MinBoardlot
,
MinBoardlot
:
sellorder
.
MinBoardlot
,
...
@@ -192,7 +193,6 @@ func (t *trade) genSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase,
...
@@ -192,7 +193,6 @@ func (t *trade) genSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase,
BlockTime
:
t
.
GetBlockTime
(),
BlockTime
:
t
.
GetBlockTime
(),
IsSellOrder
:
true
,
IsSellOrder
:
true
,
AssetExec
:
sellorder
.
AssetExec
,
AssetExec
:
sellorder
.
AssetExec
,
TxIndex
:
txIndex
,
IsFinished
:
false
,
IsFinished
:
false
,
}
}
return
order
return
order
...
@@ -206,7 +206,9 @@ func (t *trade) updateSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase
...
@@ -206,7 +206,9 @@ func (t *trade) updateSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase
return
nil
return
nil
}
}
order
,
ok
:=
xs
[
0
]
.
Data
.
(
*
pty
.
LocalOrder
)
order
,
ok
:=
xs
[
0
]
.
Data
.
(
*
pty
.
LocalOrder
)
tradelog
.
Error
(
"Table dbg"
,
"sell-update"
,
order
,
"data"
,
xs
[
0
]
.
Data
)
if
!
ok
{
if
!
ok
{
tradelog
.
Error
(
"Table failed"
,
"sell-update"
,
order
)
return
nil
return
nil
}
}
...
@@ -219,6 +221,8 @@ func (t *trade) updateSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase
...
@@ -219,6 +221,8 @@ func (t *trade) updateSellLimit(tx *types.Transaction, sell *pty.ReceiptSellBase
order
.
TradedBoardlot
=
sellorder
.
SoldBoardlot
order
.
TradedBoardlot
=
sellorder
.
SoldBoardlot
order
.
IsFinished
=
(
status
!=
pty
.
TradeOrderStatusOnSale
)
order
.
IsFinished
=
(
status
!=
pty
.
TradeOrderStatusOnSale
)
tradelog
.
Error
(
"Table"
,
"sell-update"
,
order
)
ldb
.
Replace
(
order
)
ldb
.
Replace
(
order
)
return
order
return
order
...
@@ -270,6 +274,7 @@ func (t *trade) genSellMarket(tx *types.Transaction, sell *pty.ReceiptSellBase,
...
@@ -270,6 +274,7 @@ func (t *trade) genSellMarket(tx *types.Transaction, sell *pty.ReceiptSellBase,
order
:=
&
pty
.
LocalOrder
{
order
:=
&
pty
.
LocalOrder
{
AssetSymbol
:
sell
.
TokenSymbol
,
AssetSymbol
:
sell
.
TokenSymbol
,
TxIndex
:
txIndex
,
Owner
:
sell
.
Owner
,
Owner
:
sell
.
Owner
,
AmountPerBoardlot
:
parseOrderAmountFloat
(
sell
.
AmountPerBoardlot
),
AmountPerBoardlot
:
parseOrderAmountFloat
(
sell
.
AmountPerBoardlot
),
MinBoardlot
:
sell
.
MinBoardlot
,
MinBoardlot
:
sell
.
MinBoardlot
,
...
@@ -285,7 +290,7 @@ func (t *trade) genSellMarket(tx *types.Transaction, sell *pty.ReceiptSellBase,
...
@@ -285,7 +290,7 @@ func (t *trade) genSellMarket(tx *types.Transaction, sell *pty.ReceiptSellBase,
BlockTime
:
t
.
GetBlockTime
(),
BlockTime
:
t
.
GetBlockTime
(),
IsSellOrder
:
true
,
IsSellOrder
:
true
,
AssetExec
:
sell
.
AssetExec
,
AssetExec
:
sell
.
AssetExec
,
TxIndex
:
txIndex
,
IsFinished
:
true
,
IsFinished
:
true
,
}
}
return
order
return
order
...
@@ -295,6 +300,7 @@ func (t *trade) genBuyLimit(tx *types.Transaction, buy *pty.ReceiptBuyBase, txIn
...
@@ -295,6 +300,7 @@ func (t *trade) genBuyLimit(tx *types.Transaction, buy *pty.ReceiptBuyBase, txIn
order
:=
&
pty
.
LocalOrder
{
order
:=
&
pty
.
LocalOrder
{
AssetSymbol
:
buy
.
TokenSymbol
,
AssetSymbol
:
buy
.
TokenSymbol
,
TxIndex
:
txIndex
,
Owner
:
buy
.
Owner
,
Owner
:
buy
.
Owner
,
AmountPerBoardlot
:
parseOrderAmountFloat
(
buy
.
AmountPerBoardlot
),
AmountPerBoardlot
:
parseOrderAmountFloat
(
buy
.
AmountPerBoardlot
),
MinBoardlot
:
buy
.
MinBoardlot
,
MinBoardlot
:
buy
.
MinBoardlot
,
...
@@ -310,7 +316,6 @@ func (t *trade) genBuyLimit(tx *types.Transaction, buy *pty.ReceiptBuyBase, txIn
...
@@ -310,7 +316,6 @@ func (t *trade) genBuyLimit(tx *types.Transaction, buy *pty.ReceiptBuyBase, txIn
BlockTime
:
t
.
GetBlockTime
(),
BlockTime
:
t
.
GetBlockTime
(),
IsSellOrder
:
true
,
IsSellOrder
:
true
,
AssetExec
:
buy
.
AssetExec
,
AssetExec
:
buy
.
AssetExec
,
TxIndex
:
txIndex
,
IsFinished
:
false
,
IsFinished
:
false
,
}
}
return
order
return
order
...
@@ -368,6 +373,7 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
...
@@ -368,6 +373,7 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
order
:=
&
pty
.
LocalOrder
{
order
:=
&
pty
.
LocalOrder
{
AssetSymbol
:
buy
.
TokenSymbol
,
AssetSymbol
:
buy
.
TokenSymbol
,
TxIndex
:
txIndex
,
Owner
:
buy
.
Owner
,
Owner
:
buy
.
Owner
,
AmountPerBoardlot
:
parseOrderAmountFloat
(
buy
.
AmountPerBoardlot
),
AmountPerBoardlot
:
parseOrderAmountFloat
(
buy
.
AmountPerBoardlot
),
MinBoardlot
:
buy
.
MinBoardlot
,
MinBoardlot
:
buy
.
MinBoardlot
,
...
@@ -383,7 +389,6 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
...
@@ -383,7 +389,6 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
BlockTime
:
t
.
GetBlockTime
(),
BlockTime
:
t
.
GetBlockTime
(),
IsSellOrder
:
true
,
IsSellOrder
:
true
,
AssetExec
:
buy
.
AssetExec
,
AssetExec
:
buy
.
AssetExec
,
TxIndex
:
txIndex
,
IsFinished
:
true
,
IsFinished
:
true
,
}
}
return
order
return
order
...
...
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