diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-11-13 19:47:27 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-03 20:45:35 +0800 |
commit | 6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (patch) | |
tree | c92974f8b82209073ad1ee3faec6e149f834bf69 /cmd | |
parent | b8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff) | |
download | dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip |
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/faucet/faucet.go | 2 | ||||
-rw-r--r-- | cmd/puppeth/genesis.go | 38 | ||||
-rw-r--r-- | cmd/utils/flags.go | 4 |
3 files changed, 22 insertions, 22 deletions
diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 75ec124c1..051f9254c 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -473,7 +473,7 @@ func (f *faucet) apiHandler(conn *websocket.Conn) { amount = new(big.Int).Mul(amount, new(big.Int).Exp(big.NewInt(5), big.NewInt(int64(msg.Tier)), nil)) amount = new(big.Int).Div(amount, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(msg.Tier)), nil)) - tx := types.NewTransaction(f.nonce+uint64(len(f.reqs)), address, amount, big.NewInt(21000), f.price, nil) + tx := types.NewTransaction(f.nonce+uint64(len(f.reqs)), address, amount, 21000, f.price, nil) signed, err := f.keystore.SignTx(f.account, tx, f.config.ChainId) if err != nil { f.lock.Unlock() diff --git a/cmd/puppeth/genesis.go b/cmd/puppeth/genesis.go index 5e36f7fce..f747f4739 100644 --- a/cmd/puppeth/genesis.go +++ b/cmd/puppeth/genesis.go @@ -44,7 +44,7 @@ type cppEthereumGenesisSpec struct { MaximumExtraDataSize hexutil.Uint64 `json:"maximumExtraDataSize"` MinGasLimit hexutil.Uint64 `json:"minGasLimit"` MaxGasLimit hexutil.Uint64 `json:"maxGasLimit"` - GasLimitBoundDivisor *hexutil.Big `json:"gasLimitBoundDivisor"` + GasLimitBoundDivisor hexutil.Uint64 `json:"gasLimitBoundDivisor"` MinimumDifficulty *hexutil.Big `json:"minimumDifficulty"` DifficultyBoundDivisor *hexutil.Big `json:"difficultyBoundDivisor"` DurationLimit *hexutil.Big `json:"durationLimit"` @@ -107,11 +107,11 @@ func newCppEthereumGenesisSpec(network string, genesis *core.Genesis) (*cppEther spec.Params.ChainID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64()) spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize) - spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit.Uint64()) + spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit) spec.Params.MaxGasLimit = (hexutil.Uint64)(math.MaxUint64) spec.Params.MinimumDifficulty = (*hexutil.Big)(params.MinimumDifficulty) spec.Params.DifficultyBoundDivisor = (*hexutil.Big)(params.DifficultyBoundDivisor) - spec.Params.GasLimitBoundDivisor = (*hexutil.Big)(params.GasLimitBoundDivisor) + spec.Params.GasLimitBoundDivisor = (hexutil.Uint64)(params.GasLimitBoundDivisor) spec.Params.DurationLimit = (*hexutil.Big)(params.DurationLimit) spec.Params.BlockReward = (*hexutil.Big)(ethash.FrontierBlockReward) @@ -168,26 +168,26 @@ type parityChainSpec struct { Engine struct { Ethash struct { Params struct { - MinimumDifficulty *hexutil.Big `json:"minimumDifficulty"` - DifficultyBoundDivisor *hexutil.Big `json:"difficultyBoundDivisor"` - GasLimitBoundDivisor *hexutil.Big `json:"gasLimitBoundDivisor"` - DurationLimit *hexutil.Big `json:"durationLimit"` - BlockReward *hexutil.Big `json:"blockReward"` - HomesteadTransition uint64 `json:"homesteadTransition"` - EIP150Transition uint64 `json:"eip150Transition"` - EIP160Transition uint64 `json:"eip160Transition"` - EIP161abcTransition uint64 `json:"eip161abcTransition"` - EIP161dTransition uint64 `json:"eip161dTransition"` - EIP649Reward *hexutil.Big `json:"eip649Reward"` - EIP100bTransition uint64 `json:"eip100bTransition"` - EIP649Transition uint64 `json:"eip649Transition"` + MinimumDifficulty *hexutil.Big `json:"minimumDifficulty"` + DifficultyBoundDivisor *hexutil.Big `json:"difficultyBoundDivisor"` + GasLimitBoundDivisor hexutil.Uint64 `json:"gasLimitBoundDivisor"` + DurationLimit *hexutil.Big `json:"durationLimit"` + BlockReward *hexutil.Big `json:"blockReward"` + HomesteadTransition uint64 `json:"homesteadTransition"` + EIP150Transition uint64 `json:"eip150Transition"` + EIP160Transition uint64 `json:"eip160Transition"` + EIP161abcTransition uint64 `json:"eip161abcTransition"` + EIP161dTransition uint64 `json:"eip161dTransition"` + EIP649Reward *hexutil.Big `json:"eip649Reward"` + EIP100bTransition uint64 `json:"eip100bTransition"` + EIP649Transition uint64 `json:"eip649Transition"` } `json:"params"` } `json:"Ethash"` } `json:"engine"` Params struct { MaximumExtraDataSize hexutil.Uint64 `json:"maximumExtraDataSize"` - MinGasLimit *hexutil.Big `json:"minGasLimit"` + MinGasLimit hexutil.Uint64 `json:"minGasLimit"` NetworkID hexutil.Uint64 `json:"networkID"` MaxCodeSize uint64 `json:"maxCodeSize"` EIP155Transition uint64 `json:"eip155Transition"` @@ -270,7 +270,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin } spec.Engine.Ethash.Params.MinimumDifficulty = (*hexutil.Big)(params.MinimumDifficulty) spec.Engine.Ethash.Params.DifficultyBoundDivisor = (*hexutil.Big)(params.DifficultyBoundDivisor) - spec.Engine.Ethash.Params.GasLimitBoundDivisor = (*hexutil.Big)(params.GasLimitBoundDivisor) + spec.Engine.Ethash.Params.GasLimitBoundDivisor = (hexutil.Uint64)(params.GasLimitBoundDivisor) spec.Engine.Ethash.Params.DurationLimit = (*hexutil.Big)(params.DurationLimit) spec.Engine.Ethash.Params.BlockReward = (*hexutil.Big)(ethash.FrontierBlockReward) spec.Engine.Ethash.Params.HomesteadTransition = genesis.Config.HomesteadBlock.Uint64() @@ -283,7 +283,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin spec.Engine.Ethash.Params.EIP649Transition = genesis.Config.ByzantiumBlock.Uint64() spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize) - spec.Params.MinGasLimit = (*hexutil.Big)(params.MinGasLimit) + spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit) spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64()) spec.Params.MaxCodeSize = params.MaxCodeSize spec.Params.EIP155Transition = genesis.Config.EIP155Block.Uint64() diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 30edf199c..734cf6f36 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -313,7 +313,7 @@ var ( TargetGasLimitFlag = cli.Uint64Flag{ Name: "targetgaslimit", Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine", - Value: params.GenesisGasLimit.Uint64(), + Value: params.GenesisGasLimit, } EtherbaseFlag = cli.StringFlag{ Name: "etherbase", @@ -1138,7 +1138,7 @@ func RegisterEthStatsService(stack *node.Node, url string) { // SetupNetwork configures the system for either the main net or some test network. func SetupNetwork(ctx *cli.Context) { // TODO(fjl): move target gas limit into config - params.TargetGasLimit = new(big.Int).SetUint64(ctx.GlobalUint64(TargetGasLimitFlag.Name)) + params.TargetGasLimit = ctx.GlobalUint64(TargetGasLimitFlag.Name) } // MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails. |