mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
cmd/evm: use utils.BigFlag
This commit is contained in:
parent
4f76e1e5c1
commit
8fd6e8043a
1 changed files with 13 additions and 13 deletions
|
|
@ -20,13 +20,13 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
goruntime "runtime"
|
goruntime "runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/core/vm/runtime"
|
"github.com/ethereum/go-ethereum/core/vm/runtime"
|
||||||
|
|
@ -52,20 +52,20 @@ var (
|
||||||
Name: "codefile",
|
Name: "codefile",
|
||||||
Usage: "file containing EVM code",
|
Usage: "file containing EVM code",
|
||||||
}
|
}
|
||||||
GasFlag = cli.StringFlag{
|
GasFlag = cli.Uint64Flag{
|
||||||
Name: "gas",
|
Name: "gas",
|
||||||
Usage: "gas limit for the evm",
|
Usage: "gas limit for the evm",
|
||||||
Value: "10000000000",
|
Value: 10000000000,
|
||||||
}
|
}
|
||||||
PriceFlag = cli.StringFlag{
|
PriceFlag = utils.BigFlag{
|
||||||
Name: "price",
|
Name: "price",
|
||||||
Usage: "price set for the evm",
|
Usage: "price set for the evm",
|
||||||
Value: "0",
|
Value: new(big.Int),
|
||||||
}
|
}
|
||||||
ValueFlag = cli.StringFlag{
|
ValueFlag = utils.BigFlag{
|
||||||
Name: "value",
|
Name: "value",
|
||||||
Usage: "value set for the evm",
|
Usage: "value set for the evm",
|
||||||
Value: "0",
|
Value: new(big.Int),
|
||||||
}
|
}
|
||||||
DumpFlag = cli.BoolFlag{
|
DumpFlag = cli.BoolFlag{
|
||||||
Name: "dump",
|
Name: "dump",
|
||||||
|
|
@ -161,9 +161,9 @@ func run(ctx *cli.Context) error {
|
||||||
ret, _, err = runtime.Create(input, &runtime.Config{
|
ret, _, err = runtime.Create(input, &runtime.Config{
|
||||||
Origin: sender.Address(),
|
Origin: sender.Address(),
|
||||||
State: statedb,
|
State: statedb,
|
||||||
GasLimit: math.MustParseUint64(ctx.GlobalString(GasFlag.Name)),
|
GasLimit: ctx.GlobalUint64(GasFlag.Name),
|
||||||
GasPrice: math.MustParseBig(ctx.GlobalString(PriceFlag.Name)),
|
GasPrice: utils.GlobalBig(ctx, PriceFlag.Name),
|
||||||
Value: math.MustParseBig(ctx.GlobalString(ValueFlag.Name)),
|
Value: utils.GlobalBig(ctx, ValueFlag.Name),
|
||||||
EVMConfig: vm.Config{
|
EVMConfig: vm.Config{
|
||||||
Tracer: logger,
|
Tracer: logger,
|
||||||
Debug: ctx.GlobalBool(DebugFlag.Name),
|
Debug: ctx.GlobalBool(DebugFlag.Name),
|
||||||
|
|
@ -178,9 +178,9 @@ func run(ctx *cli.Context) error {
|
||||||
ret, err = runtime.Call(receiverAddress, common.Hex2Bytes(ctx.GlobalString(InputFlag.Name)), &runtime.Config{
|
ret, err = runtime.Call(receiverAddress, common.Hex2Bytes(ctx.GlobalString(InputFlag.Name)), &runtime.Config{
|
||||||
Origin: sender.Address(),
|
Origin: sender.Address(),
|
||||||
State: statedb,
|
State: statedb,
|
||||||
GasLimit: math.MustParseUint64(ctx.GlobalString(GasFlag.Name)),
|
GasLimit: ctx.GlobalUint64(GasFlag.Name),
|
||||||
GasPrice: math.MustParseBig(ctx.GlobalString(PriceFlag.Name)),
|
GasPrice: utils.GlobalBig(ctx, PriceFlag.Name),
|
||||||
Value: math.MustParseBig(ctx.GlobalString(ValueFlag.Name)),
|
Value: utils.GlobalBig(ctx, ValueFlag.Name),
|
||||||
EVMConfig: vm.Config{
|
EVMConfig: vm.Config{
|
||||||
Tracer: logger,
|
Tracer: logger,
|
||||||
Debug: ctx.GlobalBool(DebugFlag.Name),
|
Debug: ctx.GlobalBool(DebugFlag.Name),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue