merge with quorum upstream

params: config.go and denomination.go merged with conflicts
This commit is contained in:
amalraj.manigmail.com 2019-03-18 11:43:03 +08:00
parent 849eca21da
commit b286409b7a
5 changed files with 11 additions and 10 deletions

View File

@ -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: &params.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,
},
// {

View File

@ -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

View File

@ -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

View File

@ -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"`
}

View File

@ -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
)