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
3d43c4de
Commit
3d43c4de
authored
Feb 13, 2019
by
linj
Committed by
vipwzw
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fork const
parent
0f12528b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
exec_test.go
plugin/dapp/trade/executor/exec_test.go
+2
-2
util.go
plugin/dapp/trade/executor/util.go
+2
-2
const.go
plugin/dapp/trade/types/const.go
+5
-0
trade.go
plugin/dapp/trade/types/trade.go
+2
-2
No files found.
plugin/dapp/trade/executor/exec_test.go
View file @
3d43c4de
...
...
@@ -70,7 +70,7 @@ func TestTrade_Exec_SellLimit(t *testing.T) {
env
:=
execEnv
{
1539918074
,
types
.
GetDappFork
(
"trade"
,
"ForkTradeAsset"
),
types
.
GetDappFork
(
"trade"
,
pty
.
ForkTradeAssetX
),
2
,
1539918074
,
"hash"
,
...
...
@@ -212,7 +212,7 @@ func TestTrade_Exec_BuyLimit(t *testing.T) {
env
:=
execEnv
{
1539918074
,
types
.
GetDappFork
(
"trade"
,
"ForkTradeAsset"
),
types
.
GetDappFork
(
"trade"
,
pty
.
ForkTradeAssetX
),
2
,
1539918074
,
"hash"
,
...
...
plugin/dapp/trade/executor/util.go
View file @
3d43c4de
...
...
@@ -35,7 +35,7 @@ func GetExecSymbol(order *pt.SellOrder) (string, string) {
}
func
checkAsset
(
height
int64
,
exec
,
symbol
string
)
bool
{
if
types
.
IsDappFork
(
height
,
pt
.
TradeX
,
"ForkTradeAsset"
)
{
if
types
.
IsDappFork
(
height
,
pt
.
TradeX
,
pt
.
ForkTradeAssetX
)
{
if
exec
==
""
||
symbol
==
""
{
return
false
}
...
...
@@ -48,7 +48,7 @@ func checkAsset(height int64, exec, symbol string) bool {
}
func
createAccountDB
(
height
int64
,
db
db
.
KV
,
exec
,
symbol
string
)
(
*
account
.
DB
,
error
)
{
if
types
.
IsDappFork
(
height
,
pt
.
TradeX
,
"ForkTradeAsset"
)
{
if
types
.
IsDappFork
(
height
,
pt
.
TradeX
,
pt
.
ForkTradeAssetX
)
{
return
account
.
NewAccountDB
(
exec
,
symbol
,
db
)
}
...
...
plugin/dapp/trade/types/const.go
View file @
3d43c4de
...
...
@@ -82,3 +82,8 @@ const (
//InvalidStartTime :
InvalidStartTime
=
0
)
const
(
ForkTradeAssetX
=
"ForkTradeAsset"
ForkTradeBuyLimitX
=
"ForkTradeBuyLimit"
)
plugin/dapp/trade/types/trade.go
View file @
3d43c4de
...
...
@@ -52,8 +52,8 @@ func init() {
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
TradeX
))
types
.
RegistorExecutor
(
TradeX
,
newType
())
types
.
RegisterDappFork
(
TradeX
,
"Enable"
,
100899
)
types
.
RegisterDappFork
(
TradeX
,
"ForkTradeBuyLimit"
,
301000
)
types
.
RegisterDappFork
(
TradeX
,
"ForkTradeAsset"
,
1010000
)
types
.
RegisterDappFork
(
TradeX
,
ForkTradeBuyLimitX
,
301000
)
types
.
RegisterDappFork
(
TradeX
,
ForkTradeAssetX
,
1010000
)
}
type
tradeType
struct
{
...
...
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