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
7b04d42e
Commit
7b04d42e
authored
Sep 18, 2021
by
mdj33
Committed by
vipwzw
Sep 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve code
parent
38ab5f3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
action.go
plugin/dapp/paracross/executor/action.go
+5
-5
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+1
-1
No files found.
plugin/dapp/paracross/executor/action.go
View file @
7b04d42e
...
...
@@ -992,7 +992,7 @@ func isInIgnoreHeightList(str string, status *pt.ParacrossNodeStatus) (bool, err
if
len
(
e
)
<=
2
{
return
false
,
errors
.
Wrapf
(
types
.
ErrInvalidParam
,
"wrong config str=%s,title=%s"
,
str
,
status
.
Title
)
}
if
strings
.
ToLower
(
"user.p."
+
e
[
0
]
+
"."
)
!=
strings
.
ToLower
(
status
.
Title
)
{
if
strings
.
ToLower
(
pt
.
ParaPrefix
+
e
[
0
]
+
"."
)
!=
strings
.
ToLower
(
status
.
Title
)
{
return
false
,
errors
.
Wrapf
(
types
.
ErrInvalidParam
,
"wrong title str=%s,title=%s"
,
str
,
status
.
Title
)
}
...
...
@@ -1035,7 +1035,7 @@ func isInHitHeightList(str string, status *pt.ParacrossNodeStatus) (bool, error)
if
len
(
e
)
<=
2
{
return
false
,
errors
.
Wrapf
(
types
.
ErrInvalidParam
,
"wrong config str=%s,title=%s"
,
str
,
status
.
Title
)
}
if
strings
.
ToLower
(
"user.p."
+
e
[
0
]
+
"."
)
!=
strings
.
ToLower
(
status
.
Title
)
{
if
strings
.
ToLower
(
pt
.
ParaPrefix
+
e
[
0
]
+
"."
)
!=
strings
.
ToLower
(
status
.
Title
)
{
return
false
,
errors
.
Wrapf
(
types
.
ErrInvalidParam
,
"wrong title str=%s,title=%s"
,
str
,
status
.
Title
)
}
if
e
[
1
]
!=
pt
.
ParaCrossAssetTxHitKey
{
...
...
@@ -1063,11 +1063,11 @@ func checkIsIgnoreHeight(heightList []string, status *pt.ParacrossNodeStatus) (b
}
var
hitStr
,
ignoreStr
string
hitPrefix
:=
strings
.
ToLower
(
status
.
Title
+
pt
.
ParaCrossAssetTxHitKey
)
ignorePrefix
:=
strings
.
ToLower
(
status
.
Title
+
pt
.
ParaCrossAssetTxIgnoreKey
)
hitPrefix
:=
strings
.
ToLower
(
status
.
Title
+
pt
.
ParaCrossAssetTxHitKey
)
[
len
(
pt
.
ParaPrefix
)
:
]
ignorePrefix
:=
strings
.
ToLower
(
status
.
Title
+
pt
.
ParaCrossAssetTxIgnoreKey
)
[
len
(
pt
.
ParaPrefix
)
:
]
for
_
,
s
:=
range
heightList
{
desStr
:=
pt
.
ParaPrefix
+
strings
.
ToLower
(
s
)
desStr
:=
strings
.
ToLower
(
s
)
if
strings
.
HasPrefix
(
desStr
,
hitPrefix
)
{
if
len
(
hitStr
)
>
0
{
return
false
,
errors
.
Wrapf
(
types
.
ErrInvalidParam
,
"checkIsInIgnoreHeightList repeate=%s"
,
hitPrefix
)
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
7b04d42e
...
...
@@ -880,7 +880,7 @@ func TestVerifyBlsSign(t *testing.T) {
func
TestCheckIsIgnoreHeight
(
t
*
testing
.
T
)
{
status1
:=
&
pt
.
ParacrossNodeStatus
{
Title
:
"user.p.
mc
."
,
Title
:
"user.p.
MC
."
,
Height
:
1000
,
}
strList
:=
[]
string
{
"mcc.hit.260"
,
"mc.hit.7.9.250"
,
"mc.ignore.1-100.200-300"
}
...
...
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