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
87dfa6d4
Commit
87dfa6d4
authored
Aug 20, 2021
by
hezhengjun
Committed by
vipwzw
Aug 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct the gas estimate command
parent
3c086cf4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
evm.go
plugin/dapp/evm/commands/evm.go
+10
-6
No files found.
plugin/dapp/evm/commands/evm.go
View file @
87dfa6d4
...
...
@@ -233,8 +233,7 @@ func addCreateContractFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"code"
,
"c"
,
""
,
"contract binary code"
)
_
=
cmd
.
MarkFlagRequired
(
"code"
)
cmd
.
Flags
()
.
StringP
(
"abi"
,
"b"
,
""
,
"abi string used for create constructor parameter "
)
_
=
cmd
.
MarkFlagRequired
(
"abi"
)
cmd
.
Flags
()
.
StringP
(
"abi"
,
"b"
,
""
,
"abi string used for create constructor parameter(optional, not needed if no parameter for constructor)"
)
cmd
.
Flags
()
.
StringP
(
"expire"
,
""
,
"120s"
,
"transaction expire time (optional)"
)
...
...
@@ -242,9 +241,9 @@ func addCreateContractFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"contract gas fee (optional)"
)
cmd
.
Flags
()
.
StringP
(
"alias"
,
"s"
,
""
,
"human readable contract alias name"
)
cmd
.
Flags
()
.
StringP
(
"alias"
,
"s"
,
""
,
"human readable contract alias name
(optional)
"
)
cmd
.
Flags
()
.
StringP
(
"parameter"
,
"p"
,
""
,
"parameter for constructor and should be input as constructor(xxx,xxx,xxx)"
)
cmd
.
Flags
()
.
StringP
(
"parameter"
,
"p"
,
""
,
"
(optional)
parameter for constructor and should be input as constructor(xxx,xxx,xxx)"
)
}
func
createContract
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -500,9 +499,11 @@ func callAbi(cmd *cobra.Command, args []string) {
func
estimateGas
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
txStr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"tx"
)
caller
,
_
:=
cmd
.
Flags
()
.
GetString
(
"caller"
)
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
txInfo
:=
&
types
.
ReqString
{
Data
:
txStr
,
txInfo
:=
&
evmtypes
.
EstimateEVMGasReq
{
Tx
:
txStr
,
From
:
caller
,
}
var
estGasResp
evmtypes
.
EstimateEVMGasResp
...
...
@@ -517,6 +518,9 @@ func estimateGas(cmd *cobra.Command, args []string) {
func
addEstimateGasFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"tx"
,
"x"
,
""
,
"tx string(should be signatured)"
)
_
=
cmd
.
MarkFlagRequired
(
"tx"
)
cmd
.
Flags
()
.
StringP
(
"caller"
,
"c"
,
""
,
"contract creator or caller"
)
_
=
cmd
.
MarkFlagRequired
(
"caller"
)
}
// 估算合约消耗
...
...
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