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
ed8add83
Commit
ed8add83
authored
Jan 19, 2020
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test
parent
b36a5533
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
local_order_test.go
plugin/dapp/trade/executor/local_order_test.go
+21
-0
upgrade_test.go
plugin/dapp/trade/executor/upgrade_test.go
+2
-1
No files found.
plugin/dapp/trade/executor/local_order_test.go
View file @
ed8add83
...
@@ -58,6 +58,27 @@ var order2 = &pty.LocalOrder{
...
@@ -58,6 +58,27 @@ var order2 = &pty.LocalOrder{
PriceSymbol
:
"CCNY"
,
PriceSymbol
:
"CCNY"
,
}
}
// 两个fork前的数据
var
order3
=
&
pty
.
LocalOrder
{
AssetSymbol
:
"CCNY"
,
Owner
:
"O1"
,
AmountPerBoardlot
:
1
,
MinBoardlot
:
1
,
PricePerBoardlot
:
1
,
TotalBoardlot
:
10
,
TradedBoardlot
:
0
,
BuyID
:
"B2"
,
Status
:
pty
.
TradeOrderStatusOnBuy
,
SellID
:
""
,
TxHash
:
nil
,
Height
:
3
,
Key
:
"B2"
,
BlockTime
:
3
,
IsSellOrder
:
false
,
TxIndex
:
dapp
.
HeightIndexStr
(
3
,
1
),
IsFinished
:
false
,
}
func
TestListAll
(
t
*
testing
.
T
)
{
func
TestListAll
(
t
*
testing
.
T
)
{
dir
,
ldb
,
tdb
:=
util
.
CreateTestDB
()
dir
,
ldb
,
tdb
:=
util
.
CreateTestDB
()
t
.
Log
(
dir
,
ldb
,
tdb
)
t
.
Log
(
dir
,
ldb
,
tdb
)
...
...
plugin/dapp/trade/executor/upgrade_test.go
View file @
ed8add83
...
@@ -45,6 +45,7 @@ func Test_Upgrade(t *testing.T) {
...
@@ -45,6 +45,7 @@ func Test_Upgrade(t *testing.T) {
tabV1
:=
NewOrderTable
(
localdb
)
tabV1
:=
NewOrderTable
(
localdb
)
tabV1
.
Add
(
order1
)
tabV1
.
Add
(
order1
)
tabV1
.
Add
(
order2
)
tabV1
.
Add
(
order2
)
tabV1
.
Add
(
order3
)
kvs
,
err
:=
tabV1
.
Save
()
kvs
,
err
:=
tabV1
.
Save
()
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
for
_
,
kv
:=
range
kvs
{
for
_
,
kv
:=
range
kvs
{
...
@@ -70,5 +71,5 @@ func Test_Upgrade(t *testing.T) {
...
@@ -70,5 +71,5 @@ func Test_Upgrade(t *testing.T) {
}
}
func
callUpgradeLocalDBV2
(
localdb
dbm
.
KVDB
)
error
{
func
callUpgradeLocalDBV2
(
localdb
dbm
.
KVDB
)
error
{
return
UpgradeLocalDBV2
(
localdb
)
return
UpgradeLocalDBV2
(
localdb
,
"bty"
)
}
}
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