Commit 159fd053 authored by linj's avatar linj

fix & add log to debug

parent 4c4f6066
...@@ -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.ReplyTradeOrder{}} return &table.Row{Data: &pty.LocalOrder{}}
} }
// 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment