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
049a8db4
Commit
049a8db4
authored
Jan 11, 2019
by
linj
Committed by
vipwzw
Jan 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add validSymbolForkTokenSymbolWithNumber
parent
e6a60453
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
tokendb.go
plugin/dapp/token/executor/tokendb.go
+26
-6
No files found.
plugin/dapp/token/executor/tokendb.go
View file @
049a8db4
...
...
@@ -424,7 +424,11 @@ func isUpperChar(a byte) bool {
return
res
}
func
validSymbol
(
cs
[]
byte
)
bool
{
func
isDigit
(
a
byte
)
bool
{
return
(
a
<=
'9'
&&
a
>=
'0'
)
}
func
validSymbolForkBadTokenSymbol
(
cs
[]
byte
)
bool
{
for
_
,
c
:=
range
cs
{
if
!
isUpperChar
(
c
)
{
return
false
...
...
@@ -433,11 +437,27 @@ func validSymbol(cs []byte) bool {
return
true
}
func
validSymbolForkTokenSymbolWithNumber
(
cs
[]
byte
)
bool
{
for
_
,
c
:=
range
cs
{
if
!
isUpperChar
(
c
)
&&
!
isDigit
(
c
)
{
return
false
}
}
return
true
}
func
validSymbolOriginal
(
cs
[]
byte
)
bool
{
symbol
:=
string
(
cs
)
upSymbol
:=
strings
.
ToUpper
(
symbol
)
return
upSymbol
==
symbol
}
func
validSymbolWithHeight
(
cs
[]
byte
,
height
int64
)
bool
{
if
!
types
.
IsDappFork
(
height
,
pty
.
TokenX
,
"ForkBadTokenSymbol
"
)
{
symbol
:=
string
(
cs
)
upSymbol
:=
strings
.
ToUpper
(
symbol
)
return
upSymbol
==
symbol
if
types
.
IsDappFork
(
height
,
pty
.
TokenX
,
"ForkTokenSymbolWithNumber
"
)
{
return
validSymbolForkTokenSymbolWithNumber
(
cs
)
}
else
if
types
.
IsDappFork
(
height
,
pty
.
TokenX
,
"ForkBadTokenSymbol"
)
{
return
validSymbolForkBadTokenSymbol
(
cs
)
}
return
validSymbol
(
cs
)
return
validSymbolOriginal
(
cs
)
}
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