From b286409b7a5cd1d140ed87ae57ed38c3da3edf6e Mon Sep 17 00:00:00 2001 From: "amalraj.manigmail.com" Date: Mon, 18 Mar 2019 11:43:03 +0800 Subject: [PATCH] merge with quorum upstream params: config.go and denomination.go merged with conflicts --- core/genesis_test.go | 6 +++--- core/tx_pool.go | 2 +- internal/ethapi/api.go | 2 +- params/config.go | 4 ++-- params/denomination.go | 7 ++++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/genesis_test.go b/core/genesis_test.go index a6c10b9a5..d353b3866 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -17,10 +17,10 @@ package core import ( + "errors" "math/big" "reflect" "testing" - "errors" "github.com/davecgh/go-spew/spew" "github.com/ethereum/go-ethereum/common" @@ -45,7 +45,7 @@ func TestDefaultGenesisBlock(t *testing.T) { func TestSetupGenesis(t *testing.T) { var ( // customghash = common.HexToHash("0x89c99d90b79719238d2645c7642f2c9295246e80775b38cfd162b696817fbd50") - customg = Genesis{ + customg = Genesis{ Config: ¶ms.ChainConfig{HomesteadBlock: big.NewInt(3), IsQuorum: true}, Alloc: GenesisAlloc{ {1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}}, @@ -92,7 +92,7 @@ func TestSetupGenesis(t *testing.T) { customg.Config.TransactionSizeLimit = 100000 return SetupGenesisBlock(db, &customg) }, - wantErr: errors.New("Genesis transaction size limit must be between 32 and 128"), + wantErr: errors.New("Genesis transaction size limit must be between 32 and 128"), wantConfig: customg.Config, }, // { diff --git a/core/tx_pool.go b/core/tx_pool.go index ff283bda8..30bd591f6 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -583,7 +583,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { return ErrInvalidGasPrice } // Reject transactions over 32KB (or manually set limit) to prevent DOS attacks - if float64(tx.Size()) > float64(sizeLimit * 1024) { + if float64(tx.Size()) > float64(sizeLimit*1024) { return ErrOversizedData } // Transactions can't be negative. This may never happen using RLP decoded diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 6614a0afa..8ae253bc9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -863,7 +863,7 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h intrinsicGasPrivate, _ := core.IntrinsicGas(common.Hex2Bytes(maxPrivateIntrinsicDataHex), args.To == nil, isHomestead) if intrinsicGasPrivate > intrinsicGasPublic { - if math.MaxUint64 - hi < intrinsicGasPrivate - intrinsicGasPublic { + if math.MaxUint64-hi < intrinsicGasPrivate-intrinsicGasPublic { return 0, fmt.Errorf("private intrinsic gas addition exceeds allowance") } return hexutil.Uint64(hi + (intrinsicGasPrivate - intrinsicGasPublic)), nil diff --git a/params/config.go b/params/config.go index db68ccbfb..9322edd8e 100644 --- a/params/config.go +++ b/params/config.go @@ -17,10 +17,10 @@ package params import ( + "errors" "fmt" "math" "math/big" - "errors" "github.com/ethereum/go-ethereum/common" ) @@ -188,7 +188,7 @@ type ChainConfig struct { Clique *CliqueConfig `json:"clique,omitempty"` Istanbul *IstanbulConfig `json:"istanbul,omitempty"` - IsQuorum bool `json:"isQuorum"` + IsQuorum bool `json:"isQuorum"` TransactionSizeLimit uint64 `json:"txnSizeLimit"` } diff --git a/params/denomination.go b/params/denomination.go index fb4da7f41..bbc2b4713 100644 --- a/params/denomination.go +++ b/params/denomination.go @@ -22,7 +22,8 @@ package params // new(big.Int).Mul(value, big.NewInt(params.GWei)) // const ( - Wei = 1 - GWei = 1e9 - Ether = 1e18 + Wei = 1 + GWei = 1e9 + Ether = 1e18 + Shannon = 1e9 )