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
7f98de46
Commit
7f98de46
authored
Mar 19, 2019
by
linj
Committed by
vipwzw
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge ForkTokenCheckAddress ForkTokenCheckPrepareX to ForkTokenCheck
parent
934009af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
token_test.go
plugin/dapp/token/executor/token_test.go
+1
-1
tokendb.go
plugin/dapp/token/executor/tokendb.go
+3
-3
const.go
plugin/dapp/token/types/const.go
+2
-2
types.go
plugin/dapp/token/types/types.go
+1
-2
No files found.
plugin/dapp/token/executor/token_test.go
View file @
7f98de46
...
...
@@ -68,7 +68,7 @@ func TestToken(t *testing.T) {
env
:=
execEnv
{
10
,
types
.
GetDappFork
(
pty
.
TokenX
,
"ForkTokenCheckAddress"
),
types
.
GetDappFork
(
pty
.
TokenX
,
pty
.
ForkTokenCheckX
),
1539918074
,
}
...
...
plugin/dapp/token/executor/tokendb.go
View file @
7f98de46
...
...
@@ -157,7 +157,7 @@ func (action *tokenAction) preCreate(token *pty.TokenPreCreate) (*types.Receipt,
}
else
if
token
.
GetTotal
()
>
types
.
MaxTokenBalance
||
token
.
GetTotal
()
<=
0
{
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
{
return
nil
,
err
}
...
...
@@ -365,7 +365,7 @@ func checkTokenExist(token string, db dbm.KV) bool {
return
err
==
nil
}
// bug: prepare again after revoke, need to check status, fixed in fork ForkTokenCheck
Prepare
X
// bug: prepare again after revoke, need to check status, fixed in fork ForkTokenCheckX
func
checkTokenHasPrecreate
(
token
,
owner
string
,
status
int32
,
db
dbm
.
KV
)
bool
{
_
,
err
:=
db
.
Get
(
calcTokenAddrKeyS
(
token
,
owner
))
if
err
==
nil
{
...
...
@@ -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
{
if
!
types
.
IsDappFork
(
height
,
pty
.
TokenX
,
pty
.
ForkTokenCheck
Prepare
X
)
{
if
!
types
.
IsDappFork
(
height
,
pty
.
TokenX
,
pty
.
ForkTokenCheckX
)
{
return
checkTokenHasPrecreate
(
token
,
owner
,
pty
.
TokenStatusPreCreated
,
db
)
}
...
...
plugin/dapp/token/types/const.go
View file @
7f98de46
...
...
@@ -47,8 +47,8 @@ var (
ForkTokenPriceX
=
"ForkTokenPrice"
// ForkTokenSymbolWithNumberX fork const
ForkTokenSymbolWithNumberX
=
"ForkTokenSymbolWithNumber"
// ForkTokenCheck
Prepare
X fork check impl bug
ForkTokenCheck
PrepareX
=
"ForkTokenCheckPrepare
"
// ForkTokenCheckX fork check impl bug
ForkTokenCheck
X
=
"ForkTokenCheck
"
)
const
(
...
...
plugin/dapp/token/types/types.go
View file @
7f98de46
...
...
@@ -23,8 +23,7 @@ func init() {
types
.
RegisterDappFork
(
TokenX
,
ForkBadTokenSymbolX
,
184000
)
types
.
RegisterDappFork
(
TokenX
,
ForkTokenPriceX
,
560000
)
types
.
RegisterDappFork
(
TokenX
,
ForkTokenSymbolWithNumberX
,
1298600
)
types
.
RegisterDappFork
(
TokenX
,
"ForkTokenCheckAddress"
,
1600000
)
types
.
RegisterDappFork
(
TokenX
,
ForkTokenCheckPrepareX
,
1600000
)
types
.
RegisterDappFork
(
TokenX
,
ForkTokenCheckX
,
1600000
)
}
// TokenType 执行器基类结构体
...
...
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