Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multisend
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
李伟@五瓣科技
multisend
Commits
22230e08
Commit
22230e08
authored
Mar 14, 2022
by
gshx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'heco-testnet' of
https://code.wuban.net.cn/liwei/multisend
into heco-testnet
parents
ca527f36
0c6ea0bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
29 deletions
+9
-29
http.go
http.go
+9
-29
No files found.
http.go
View file @
22230e08
...
@@ -142,7 +142,7 @@ func (web *WebServicer) ParamHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -142,7 +142,7 @@ func (web *WebServicer) ParamHandler(w http.ResponseWriter, r *http.Request) {
resp
.
MaxTxCount
=
MaxTxCount
resp
.
MaxTxCount
=
MaxTxCount
resp
.
MaxRequestAmount
=
MaxRequestAmount
resp
.
MaxRequestAmount
=
MaxRequestAmount
for
i
:=
0
;
i
<=
1000
;
i
++
{
for
i
:=
1
;
i
<=
1001
;
i
++
{
path
:=
hdwallet
.
MustParseDerivationPath
(
fmt
.
Sprintf
(
"m/44'/60'/0'/0/%d"
,
i
))
path
:=
hdwallet
.
MustParseDerivationPath
(
fmt
.
Sprintf
(
"m/44'/60'/0'/0/%d"
,
i
))
account
,
err
:=
wallet
.
Derive
(
path
,
false
)
account
,
err
:=
wallet
.
Derive
(
path
,
false
)
...
@@ -151,7 +151,7 @@ func (web *WebServicer) ParamHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -151,7 +151,7 @@ func (web *WebServicer) ParamHandler(w http.ResponseWriter, r *http.Request) {
return
return
}
}
if
i
==
0
{
if
i
==
1
{
resp
.
From
=
account
.
Address
.
Hex
()
resp
.
From
=
account
.
Address
.
Hex
()
continue
continue
}
}
...
@@ -310,31 +310,6 @@ func (web *WebServicer) Calculate(w http.ResponseWriter, r *http.Request) {
...
@@ -310,31 +310,6 @@ func (web *WebServicer) Calculate(w http.ResponseWriter, r *http.Request) {
everyTxAmountAsStr
:=
r
.
URL
.
Query
()
.
Get
(
"everyTxAmount"
)
everyTxAmountAsStr
:=
r
.
URL
.
Query
()
.
Get
(
"everyTxAmount"
)
txNumStr
:=
r
.
URL
.
Query
()
.
Get
(
"txNum"
)
txNumStr
:=
r
.
URL
.
Query
()
.
Get
(
"txNum"
)
requestAmountAsInt
,
err
:=
strconv
.
ParseInt
(
requestAmountAsStr
,
10
,
64
)
// if err != nil {
// http.Error(w, err.Error(), http.StatusBadRequest)
// return
// }
// currentAmount, err := strconv.ParseInt(currentAmountStr, 10, 64) // strconv.Atoi(currentAmountStr)
// if err != nil {
// http.Error(w, err.Error(), http.StatusBadRequest)
// return
// }
// everyTxAmountAsInt, err := strconv.ParseInt(everyTxAmountAsStr, 10, 64) // strconv.Atoi(everyTxAmountAsStr)
// if err != nil {
// http.Error(w, err.Error(), http.StatusBadRequest)
// return
// }
// txNum, err := strconv.ParseInt(txNumStr, 10, 64) //strconv.Atoi(txNumStr)
// if err != nil {
// http.Error(w, err.Error(), http.StatusBadRequest)
// return
// }
requestAmount
,
err
:=
decimal
.
NewFromString
(
requestAmountAsStr
)
requestAmount
,
err
:=
decimal
.
NewFromString
(
requestAmountAsStr
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
@@ -361,11 +336,16 @@ func (web *WebServicer) Calculate(w http.ResponseWriter, r *http.Request) {
...
@@ -361,11 +336,16 @@ func (web *WebServicer) Calculate(w http.ResponseWriter, r *http.Request) {
res
:=
requestAmount
.
Add
(
currentAmount
)
.
Sub
(
everyTxAmount
.
Mul
(
txNum
))
res
:=
requestAmount
.
Add
(
currentAmount
)
.
Sub
(
everyTxAmount
.
Mul
(
txNum
))
fmt
.
Printf
(
"len(resAsJson): %v
\n
"
,
res
.
String
())
resAsJson
,
err
:=
json
.
Marshal
(
res
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
return
}
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/json"
)
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/json"
)
w
.
WriteHeader
(
http
.
StatusOK
)
w
.
WriteHeader
(
http
.
StatusOK
)
w
.
Write
(
[]
byte
(
res
.
String
())
)
w
.
Write
(
resAsJson
)
}
}
...
...
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