Commit 7f98de46 authored by linj's avatar linj Committed by vipwzw

merge ForkTokenCheckAddress ForkTokenCheckPrepareX to ForkTokenCheck

parent 934009af
...@@ -68,7 +68,7 @@ func TestToken(t *testing.T) { ...@@ -68,7 +68,7 @@ func TestToken(t *testing.T) {
env := execEnv{ env := execEnv{
10, 10,
types.GetDappFork(pty.TokenX, "ForkTokenCheckAddress"), types.GetDappFork(pty.TokenX, pty.ForkTokenCheckX),
1539918074, 1539918074,
} }
......
...@@ -157,7 +157,7 @@ func (action *tokenAction) preCreate(token *pty.TokenPreCreate) (*types.Receipt, ...@@ -157,7 +157,7 @@ func (action *tokenAction) preCreate(token *pty.TokenPreCreate) (*types.Receipt,
} else if token.GetTotal() > types.MaxTokenBalance || token.GetTotal() <= 0 { } else if token.GetTotal() > types.MaxTokenBalance || token.GetTotal() <= 0 {
return nil, pty.ErrTokenTotalOverflow return nil, pty.ErrTokenTotalOverflow
} }
if types.IsDappFork(action.height, pty.TokenX, "ForkTokenCheckAddress") { if types.IsDappFork(action.height, pty.TokenX, pty.ForkTokenCheckX) {
if err := address.CheckAddress(token.Owner); err != nil { if err := address.CheckAddress(token.Owner); err != nil {
return nil, err return nil, err
} }
...@@ -365,7 +365,7 @@ func checkTokenExist(token string, db dbm.KV) bool { ...@@ -365,7 +365,7 @@ func checkTokenExist(token string, db dbm.KV) bool {
return err == nil return err == nil
} }
// bug: prepare again after revoke, need to check status, fixed in fork ForkTokenCheckPrepareX // bug: prepare again after revoke, need to check status, fixed in fork ForkTokenCheckX
func checkTokenHasPrecreate(token, owner string, status int32, db dbm.KV) bool { func checkTokenHasPrecreate(token, owner string, status int32, db dbm.KV) bool {
_, err := db.Get(calcTokenAddrKeyS(token, owner)) _, err := db.Get(calcTokenAddrKeyS(token, owner))
if err == nil { if err == nil {
...@@ -376,7 +376,7 @@ func checkTokenHasPrecreate(token, owner string, status int32, db dbm.KV) bool { ...@@ -376,7 +376,7 @@ func checkTokenHasPrecreate(token, owner string, status int32, db dbm.KV) bool {
} }
func checkTokenHasPrecreateWithHeight(token, owner string, db dbm.KV, height int64) bool { func checkTokenHasPrecreateWithHeight(token, owner string, db dbm.KV, height int64) bool {
if !types.IsDappFork(height, pty.TokenX, pty.ForkTokenCheckPrepareX) { if !types.IsDappFork(height, pty.TokenX, pty.ForkTokenCheckX) {
return checkTokenHasPrecreate(token, owner, pty.TokenStatusPreCreated, db) return checkTokenHasPrecreate(token, owner, pty.TokenStatusPreCreated, db)
} }
......
...@@ -47,8 +47,8 @@ var ( ...@@ -47,8 +47,8 @@ var (
ForkTokenPriceX = "ForkTokenPrice" ForkTokenPriceX = "ForkTokenPrice"
// ForkTokenSymbolWithNumberX fork const // ForkTokenSymbolWithNumberX fork const
ForkTokenSymbolWithNumberX = "ForkTokenSymbolWithNumber" ForkTokenSymbolWithNumberX = "ForkTokenSymbolWithNumber"
// ForkTokenCheckPrepareX fork check impl bug // ForkTokenCheckX fork check impl bug
ForkTokenCheckPrepareX = "ForkTokenCheckPrepare" ForkTokenCheckX = "ForkTokenCheck"
) )
const ( const (
......
...@@ -23,8 +23,7 @@ func init() { ...@@ -23,8 +23,7 @@ func init() {
types.RegisterDappFork(TokenX, ForkBadTokenSymbolX, 184000) types.RegisterDappFork(TokenX, ForkBadTokenSymbolX, 184000)
types.RegisterDappFork(TokenX, ForkTokenPriceX, 560000) types.RegisterDappFork(TokenX, ForkTokenPriceX, 560000)
types.RegisterDappFork(TokenX, ForkTokenSymbolWithNumberX, 1298600) types.RegisterDappFork(TokenX, ForkTokenSymbolWithNumberX, 1298600)
types.RegisterDappFork(TokenX, "ForkTokenCheckAddress", 1600000) types.RegisterDappFork(TokenX, ForkTokenCheckX, 1600000)
types.RegisterDappFork(TokenX, ForkTokenCheckPrepareX, 1600000)
} }
// TokenType 执行器基类结构体 // TokenType 执行器基类结构体
......
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