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
e7c1e4ab
Commit
e7c1e4ab
authored
Nov 18, 2020
by
linj
Committed by
33cn
Nov 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误提示
parent
c14f2edb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
tokendb.go
plugin/dapp/token/executor/tokendb.go
+8
-5
errors.go
plugin/dapp/token/types/errors.go
+2
-0
No files found.
plugin/dapp/token/executor/tokendb.go
View file @
e7c1e4ab
...
...
@@ -187,6 +187,9 @@ func (action *tokenAction) preCreate(token *pty.TokenPreCreate) (*types.Receipt,
if
cfg
.
IsDappFork
(
action
.
height
,
pty
.
TokenX
,
pty
.
ForkTokenBlackListX
)
{
found
,
err
:=
inBlacklist
(
token
.
GetSymbol
(),
blacklist
,
action
.
db
)
if
err
!=
nil
{
if
err
==
types
.
ErrNotFound
{
return
nil
,
pty
.
ErrTokenBlacklistNotInit
}
return
nil
,
err
}
if
found
{
...
...
@@ -402,7 +405,7 @@ func checkTokenHasPrecreateWithHeight(cfg *types.Chain33Config, token, owner str
}
func
validFinisher
(
addr
string
,
db
dbm
.
KV
)
(
bool
,
error
)
{
return
validOperator
(
addr
,
finisherKey
,
db
)
return
hasConfiged
(
addr
,
finisherKey
,
db
)
}
func
getManageKey
(
key
string
,
db
dbm
.
KV
)
([]
byte
,
error
)
{
...
...
@@ -425,7 +428,7 @@ func getConfigKey(key string, db dbm.KV) ([]byte, error) {
return
value
,
nil
}
func
validOperator
(
addr
,
key
string
,
db
dbm
.
KV
)
(
bool
,
error
)
{
func
hasConfiged
(
v1
,
key
string
,
db
dbm
.
KV
)
(
bool
,
error
)
{
value
,
err
:=
getManageKey
(
key
,
db
)
if
err
!=
nil
{
tokenlog
.
Info
(
"tokendb"
,
"get db key"
,
"not found"
,
"key"
,
key
)
...
...
@@ -443,8 +446,8 @@ func validOperator(addr, key string, db dbm.KV) (bool, error) {
return
false
,
err
// types.ErrBadConfigValue
}
for
_
,
op
:=
range
item
.
GetArr
()
.
Value
{
if
op
==
addr
{
for
_
,
v
:=
range
item
.
GetArr
()
.
Value
{
if
v
==
v1
{
return
true
,
nil
}
}
...
...
@@ -501,7 +504,7 @@ func AddTokenToAssets(addr string, db dbm.KVDB, symbol string) []*types.KeyValue
}
func
inBlacklist
(
symbol
,
key
string
,
db
dbm
.
KV
)
(
bool
,
error
)
{
found
,
err
:=
validOperator
(
symbol
,
key
,
db
)
found
,
err
:=
hasConfiged
(
symbol
,
key
,
db
)
return
found
,
err
}
...
...
plugin/dapp/token/types/errors.go
View file @
e7c1e4ab
...
...
@@ -35,4 +35,6 @@ var (
ErrTokenBlacklist
=
errors
.
New
(
"ErrTokenBlacklist"
)
// ErrTokenNotExist error token symbol not exist
ErrTokenNotExist
=
errors
.
New
(
"ErrTokenSymbolNotExist"
)
// ErrTokenBlacklistNotInit error token hasn't init blacklist
ErrTokenBlacklistNotInit
=
errors
.
New
(
"ErrTokenBlacklistNotInit"
)
)
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