Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChainGrpcPro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
duanjinfei
ChainGrpcPro
Commits
a5410c05
Commit
a5410c05
authored
Mar 09, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change batch recovertx struct and log print
parent
fcbafb8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
bathTest.go
transaction/bathTest.go
+15
-6
No files found.
transaction/bathTest.go
View file @
a5410c05
...
...
@@ -227,7 +227,13 @@ func batchRecoverTx(client crypterv1.CrypterServiceClient, sleepTime int) {
atomic
.
AddInt64
(
&
bathHandleSendCount
,
1
)
sinceTime
:=
time
.
Since
(
sendTranStartTime
)
.
Milliseconds
()
atomic
.
AddInt64
(
&
totalSendTime
,
sinceTime
)
log
.
Infof
(
"Send transaction time: %d ms, sign: %s "
,
sinceTime
,
sign
.
String
())
for
i
,
tx
:=
range
sign
.
GetRecoverdTx
()
{
rawTx
:=
batchRecoverTx
.
RawTx
if
tx
.
From
.
Hex
()
!=
rawTx
[
i
]
.
From
.
Hex
()
{
log
.
Error
(
" tx.From.Hex():"
,
tx
.
From
.
Hex
(),
"rawTx[i].From.Hex():"
,
rawTx
[
i
]
.
From
.
Hex
())
}
}
log
.
Infof
(
"Send transaction time: %d ms, sign: %s "
,
sinceTime
)
}
}
}
...
...
@@ -243,11 +249,11 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error
}
allSignedTxCount
=
int64
(
len
(
tranArr
))
startTime
:=
time
.
Now
()
rawTxArr
:=
make
([]
*
v1
.
MetaTxBase
,
0
)
for
i
:=
0
;
i
<
int
(
allSignedTxCount
);
i
++
{
tran
:=
tranArr
[
i
]
v
,
r
,
s
:=
tran
.
RawSignatureValues
()
rawTxArr
:=
make
([]
*
v1
.
MetaTxBase
,
0
)
toaddr
:=
metatypes
.
BytesToAddress
(
tran
.
To
()
.
Bytes
())
toAddr
:=
metatypes
.
BytesToAddress
(
tran
.
To
()
.
Bytes
())
hash
:=
metatypes
.
HexToHash
(
tran
.
Hash
()
.
Hex
())
nv
:=
metatypes
.
NewBigInt
(
0
)
nv
.
Set
(
v
)
...
...
@@ -261,7 +267,7 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error
Nonce
:
tran
.
Nonce
(),
GasPrice
:
metatypes
.
NewBigInt
(
tran
.
GasPrice
()
.
Int64
()),
Gas
:
tran
.
Gas
(),
To
:
&
to
a
ddr
,
To
:
&
to
A
ddr
,
Value
:
metatypes
.
NewBigInt
(
tran
.
Value
()
.
Int64
()),
Data
:
tran
.
Data
(),
AccessList
:
nil
,
...
...
@@ -274,10 +280,13 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error
req
:=
crypterv1
.
BatchRecoverTxRequest
{
RawTx
:
rawTxArr
,
}
if
len
(
rawTxArr
)
==
cfg
.
SignCount
{
batchRecoverTxRequest
<-
&
req
rawTxArr
=
make
([]
*
v1
.
MetaTxBase
,
0
)
}
}
for
{
if
bathHandleSendCount
==
allSignedTxCount
{
if
bathHandleSendCount
==
allSignedTxCount
/
int64
(
cfg
.
SignCount
)
{
log
.
Infof
(
"Send tran count: %d"
,
bathHandleSendCount
)
log
.
Infof
(
"Since time: %d ms"
,
time
.
Since
(
startTime
)
.
Milliseconds
())
break
...
...
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