Commit 3d43c4de authored by linj's avatar linj Committed by vipwzw

add fork const

parent 0f12528b
...@@ -70,7 +70,7 @@ func TestTrade_Exec_SellLimit(t *testing.T) { ...@@ -70,7 +70,7 @@ func TestTrade_Exec_SellLimit(t *testing.T) {
env := execEnv{ env := execEnv{
1539918074, 1539918074,
types.GetDappFork("trade", "ForkTradeAsset"), types.GetDappFork("trade", pty.ForkTradeAssetX),
2, 2,
1539918074, 1539918074,
"hash", "hash",
...@@ -212,7 +212,7 @@ func TestTrade_Exec_BuyLimit(t *testing.T) { ...@@ -212,7 +212,7 @@ func TestTrade_Exec_BuyLimit(t *testing.T) {
env := execEnv{ env := execEnv{
1539918074, 1539918074,
types.GetDappFork("trade", "ForkTradeAsset"), types.GetDappFork("trade", pty.ForkTradeAssetX),
2, 2,
1539918074, 1539918074,
"hash", "hash",
......
...@@ -35,7 +35,7 @@ func GetExecSymbol(order *pt.SellOrder) (string, string) { ...@@ -35,7 +35,7 @@ func GetExecSymbol(order *pt.SellOrder) (string, string) {
} }
func checkAsset(height int64, exec, symbol string) bool { 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 == "" { if exec == "" || symbol == "" {
return false return false
} }
...@@ -48,7 +48,7 @@ func checkAsset(height int64, exec, symbol string) bool { ...@@ -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) { 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) return account.NewAccountDB(exec, symbol, db)
} }
......
...@@ -82,3 +82,8 @@ const ( ...@@ -82,3 +82,8 @@ const (
//InvalidStartTime : //InvalidStartTime :
InvalidStartTime = 0 InvalidStartTime = 0
) )
const (
ForkTradeAssetX = "ForkTradeAsset"
ForkTradeBuyLimitX = "ForkTradeBuyLimit"
)
...@@ -52,8 +52,8 @@ func init() { ...@@ -52,8 +52,8 @@ func init() {
types.AllowUserExec = append(types.AllowUserExec, []byte(TradeX)) types.AllowUserExec = append(types.AllowUserExec, []byte(TradeX))
types.RegistorExecutor(TradeX, newType()) types.RegistorExecutor(TradeX, newType())
types.RegisterDappFork(TradeX, "Enable", 100899) types.RegisterDappFork(TradeX, "Enable", 100899)
types.RegisterDappFork(TradeX, "ForkTradeBuyLimit", 301000) types.RegisterDappFork(TradeX, ForkTradeBuyLimitX, 301000)
types.RegisterDappFork(TradeX, "ForkTradeAsset", 1010000) types.RegisterDappFork(TradeX, ForkTradeAssetX, 1010000)
} }
type tradeType struct { type tradeType struct {
......
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