mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
Co-authored-by: wit <wit765765346@gmail>
This commit is contained in:
parent
4e234f231a
commit
12eab8e785
29 changed files with 71 additions and 71 deletions
|
|
@ -183,8 +183,8 @@ func initGenesis(ctx *cli.Context) error {
|
||||||
utils.Fatalf("invalid genesis json: %v", err)
|
utils.Fatalf("invalid genesis json: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if genesis.Config.ChainId != nil {
|
if genesis.Config.ChainID != nil {
|
||||||
common.CopyConstants(genesis.Config.ChainId.Uint64())
|
common.CopyConstants(genesis.Config.ChainID.Uint64())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open and initialise both full and light databases
|
// Open and initialise both full and light databases
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,8 @@ func newCppEthereumGenesisSpec(network string, genesis *core.Genesis) (*cppEther
|
||||||
spec.Params.ByzantiumForkBlock = (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64())
|
spec.Params.ByzantiumForkBlock = (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64())
|
||||||
spec.Params.ConstantinopleForkBlock = (hexutil.Uint64)(math.MaxUint64)
|
spec.Params.ConstantinopleForkBlock = (hexutil.Uint64)(math.MaxUint64)
|
||||||
|
|
||||||
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
|
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
|
||||||
spec.Params.ChainID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
|
spec.Params.ChainID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
|
||||||
|
|
||||||
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
|
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
|
||||||
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
|
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
|
||||||
|
|
@ -285,7 +285,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
|
||||||
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
|
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
|
||||||
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
|
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
|
||||||
spec.Params.GasLimitBoundDivisor = (hexutil.Uint64)(params.GasLimitBoundDivisor)
|
spec.Params.GasLimitBoundDivisor = (hexutil.Uint64)(params.GasLimitBoundDivisor)
|
||||||
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
|
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
|
||||||
spec.Params.MaxCodeSize = params.MaxCodeSize
|
spec.Params.MaxCodeSize = params.MaxCodeSize
|
||||||
spec.Params.EIP155Transition = genesis.Config.EIP155Block.Uint64()
|
spec.Params.EIP155Transition = genesis.Config.EIP155Block.Uint64()
|
||||||
spec.Params.EIP98Transition = math.MaxUint64
|
spec.Params.EIP98Transition = math.MaxUint64
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func (w *wizard) deployFaucet() {
|
||||||
existed := err == nil
|
existed := err == nil
|
||||||
|
|
||||||
infos.node.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
infos.node.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
||||||
infos.node.network = w.conf.Genesis.Config.ChainId.Int64()
|
infos.node.network = w.conf.Genesis.Config.ChainID.Int64()
|
||||||
|
|
||||||
// Figure out which port to listen on
|
// Figure out which port to listen on
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ func (w *wizard) makeGenesis() {
|
||||||
// Query the user for some custom extras
|
// Query the user for some custom extras
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
fmt.Println("Specify your chain/network ID if you want an explicit one (default = random)")
|
fmt.Println("Specify your chain/network ID if you want an explicit one (default = random)")
|
||||||
genesis.Config.ChainId = new(big.Int).SetUint64(uint64(w.readDefaultInt(rand.Intn(65536))))
|
genesis.Config.ChainID = new(big.Int).SetUint64(uint64(w.readDefaultInt(rand.Intn(65536))))
|
||||||
|
|
||||||
// All done, store the genesis and flush to disk
|
// All done, store the genesis and flush to disk
|
||||||
log.Info("Configured new genesis block")
|
log.Info("Configured new genesis block")
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ func (w *wizard) deployNode(boot bool) {
|
||||||
existed := err == nil
|
existed := err == nil
|
||||||
|
|
||||||
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
||||||
infos.network = w.conf.Genesis.Config.ChainId.Int64()
|
infos.network = w.conf.Genesis.Config.ChainID.Int64()
|
||||||
|
|
||||||
// Figure out where the user wants to store the persistent data
|
// Figure out where the user wants to store the persistent data
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ func (w *wizard) deployWallet() {
|
||||||
existed := err == nil
|
existed := err == nil
|
||||||
|
|
||||||
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
|
||||||
infos.network = w.conf.Genesis.Config.ChainId.Int64()
|
infos.network = w.conf.Genesis.Config.ChainID.Int64()
|
||||||
|
|
||||||
// Figure out which port to listen on
|
// Figure out which port to listen on
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ func (api *API) GetV2BlockByHash(blockHash common.Hash) *V2BlockInfo {
|
||||||
|
|
||||||
func (api *API) NetworkInformation() NetworkInformation {
|
func (api *API) NetworkInformation() NetworkInformation {
|
||||||
info := NetworkInformation{}
|
info := NetworkInformation{}
|
||||||
info.NetworkId = api.chain.Config().ChainId
|
info.NetworkId = api.chain.Config().ChainID
|
||||||
info.XDCValidatorAddress = common.MasternodeVotingSMCBinary
|
info.XDCValidatorAddress = common.MasternodeVotingSMCBinary
|
||||||
info.LendingAddress = common.LendingRegistrationSMC
|
info.LendingAddress = common.LendingRegistrationSMC
|
||||||
info.RelayerRegistrationAddress = common.RelayerRegistrationSMC
|
info.RelayerRegistrationAddress = common.RelayerRegistrationSMC
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *txpool.TxPool,
|
||||||
// Create and send tx to smart contract for sign validate block.
|
// Create and send tx to smart contract for sign validate block.
|
||||||
nonce := pool.Nonce(account.Address)
|
nonce := pool.Nonce(account.Address)
|
||||||
tx := CreateTxSign(block.Number(), block.Hash(), nonce, common.BlockSignersBinary)
|
tx := CreateTxSign(block.Number(), block.Hash(), nonce, common.BlockSignersBinary)
|
||||||
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainId)
|
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create tx sign", "error", err)
|
log.Error("Fail to create tx sign", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
@ -116,7 +116,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *txpool.TxPool,
|
||||||
log.Error("Fail to get tx opening for randomize", "error", err)
|
log.Error("Fail to get tx opening for randomize", "error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainId)
|
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create tx secret", "error", err)
|
log.Error("Fail to create tx secret", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
@ -145,7 +145,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *txpool.TxPool,
|
||||||
log.Error("Fail to get tx opening for randomize", "error", err)
|
log.Error("Fail to get tx opening for randomize", "error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainId)
|
txSigned, err := wallet.SignTx(account, tx, chainConfig.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create tx opening", "error", err)
|
log.Error("Fail to create tx opening", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
|
||||||
bc.currentFastBlock.Store(nilBlock)
|
bc.currentFastBlock.Store(nilBlock)
|
||||||
|
|
||||||
// Update chain info data metrics
|
// Update chain info data metrics
|
||||||
chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainId.String()})
|
chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainID.String()})
|
||||||
|
|
||||||
if err := bc.loadLastState(); err != nil {
|
if err := bc.loadLastState(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -1058,7 +1058,7 @@ func TestEIP155Transition(t *testing.T) {
|
||||||
funds = big.NewInt(1000000000)
|
funds = big.NewInt(1000000000)
|
||||||
deleteAddr = common.Address{1}
|
deleteAddr = common.Address{1}
|
||||||
gspec = &Genesis{
|
gspec = &Genesis{
|
||||||
Config: ¶ms.ChainConfig{ChainId: big.NewInt(1), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)},
|
Config: ¶ms.ChainConfig{ChainID: big.NewInt(1), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)},
|
||||||
Alloc: types.GenesisAlloc{address: {Balance: funds}, deleteAddr: {Balance: new(big.Int)}},
|
Alloc: types.GenesisAlloc{address: {Balance: funds}, deleteAddr: {Balance: new(big.Int)}},
|
||||||
}
|
}
|
||||||
genesis = gspec.MustCommit(db)
|
genesis = gspec.MustCommit(db)
|
||||||
|
|
@ -1129,7 +1129,7 @@ func TestEIP155Transition(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate an invalid chain id transaction
|
// generate an invalid chain id transaction
|
||||||
config := ¶ms.ChainConfig{ChainId: big.NewInt(2), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}
|
config := ¶ms.ChainConfig{ChainID: big.NewInt(2), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}
|
||||||
blocks, _ = GenerateChain(config, blocks[len(blocks)-1], ethash.NewFaker(), db, 4, func(i int, block *BlockGen) {
|
blocks, _ = GenerateChain(config, blocks[len(blocks)-1], ethash.NewFaker(), db, 4, func(i int, block *BlockGen) {
|
||||||
var (
|
var (
|
||||||
tx *types.Transaction
|
tx *types.Transaction
|
||||||
|
|
@ -1162,7 +1162,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
|
||||||
theAddr = common.Address{1}
|
theAddr = common.Address{1}
|
||||||
gspec = &Genesis{
|
gspec = &Genesis{
|
||||||
Config: ¶ms.ChainConfig{
|
Config: ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: new(big.Int),
|
HomesteadBlock: new(big.Int),
|
||||||
EIP155Block: new(big.Int),
|
EIP155Block: new(big.Int),
|
||||||
EIP158Block: big.NewInt(2),
|
EIP158Block: big.NewInt(2),
|
||||||
|
|
@ -1600,7 +1600,7 @@ func TestEIP2718Transition(t *testing.T) {
|
||||||
funds = big.NewInt(1000000000000000)
|
funds = big.NewInt(1000000000000000)
|
||||||
gspec = &Genesis{
|
gspec = &Genesis{
|
||||||
Config: ¶ms.ChainConfig{
|
Config: ¶ms.ChainConfig{
|
||||||
ChainId: new(big.Int).SetBytes([]byte("eip1559")),
|
ChainID: new(big.Int).SetBytes([]byte("eip1559")),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
|
|
@ -1637,7 +1637,7 @@ func TestEIP2718Transition(t *testing.T) {
|
||||||
// One transaction to 0xAAAA
|
// One transaction to 0xAAAA
|
||||||
signer := types.LatestSigner(gspec.Config)
|
signer := types.LatestSigner(gspec.Config)
|
||||||
tx, _ := types.SignNewTx(key, signer, &types.AccessListTx{
|
tx, _ := types.SignNewTx(key, signer, &types.AccessListTx{
|
||||||
ChainID: gspec.Config.ChainId,
|
ChainID: gspec.Config.ChainID,
|
||||||
Nonce: 0,
|
Nonce: 0,
|
||||||
To: &aa,
|
To: &aa,
|
||||||
Gas: 30000,
|
Gas: 30000,
|
||||||
|
|
@ -1826,7 +1826,7 @@ func TestEIP3651(t *testing.T) {
|
||||||
b.SetCoinbase(aa)
|
b.SetCoinbase(aa)
|
||||||
// One transaction to Coinbase
|
// One transaction to Coinbase
|
||||||
txdata := &types.DynamicFeeTx{
|
txdata := &types.DynamicFeeTx{
|
||||||
ChainID: gspec.Config.ChainId,
|
ChainID: gspec.Config.ChainID,
|
||||||
Nonce: 0,
|
Nonce: 0,
|
||||||
To: &bb,
|
To: &bb,
|
||||||
Gas: 500000,
|
Gas: 500000,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ import (
|
||||||
func TestStateProcessorErrors(t *testing.T) {
|
func TestStateProcessorErrors(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
config = ¶ms.ChainConfig{
|
config = ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
|
|
@ -204,7 +204,7 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
gspec = &Genesis{
|
gspec = &Genesis{
|
||||||
Config: ¶ms.ChainConfig{
|
Config: ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,8 @@ func pricedDataTransaction(nonce uint64, gaslimit uint64, gasprice *big.Int, key
|
||||||
}
|
}
|
||||||
|
|
||||||
func dynamicFeeTx(nonce uint64, gaslimit uint64, gasFee *big.Int, tip *big.Int, key *ecdsa.PrivateKey) *types.Transaction {
|
func dynamicFeeTx(nonce uint64, gaslimit uint64, gasFee *big.Int, tip *big.Int, key *ecdsa.PrivateKey) *types.Transaction {
|
||||||
tx, _ := types.SignNewTx(key, types.LatestSignerForChainID(params.TestChainConfig.ChainId), &types.DynamicFeeTx{
|
tx, _ := types.SignNewTx(key, types.LatestSignerForChainID(params.TestChainConfig.ChainID), &types.DynamicFeeTx{
|
||||||
ChainID: params.TestChainConfig.ChainId,
|
ChainID: params.TestChainConfig.ChainID,
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
GasTipCap: tip,
|
GasTipCap: tip,
|
||||||
GasFeeCap: gasFee,
|
GasFeeCap: gasFee,
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
|
||||||
var signer Signer
|
var signer Signer
|
||||||
switch {
|
switch {
|
||||||
case config.IsEIP1559(blockNumber):
|
case config.IsEIP1559(blockNumber):
|
||||||
signer = NewLondonSigner(config.ChainId)
|
signer = NewLondonSigner(config.ChainID)
|
||||||
case config.IsEIP155(blockNumber):
|
case config.IsEIP155(blockNumber):
|
||||||
signer = NewEIP155Signer(config.ChainId)
|
signer = NewEIP155Signer(config.ChainID)
|
||||||
case config.IsHomestead(blockNumber):
|
case config.IsHomestead(blockNumber):
|
||||||
signer = HomesteadSigner{}
|
signer = HomesteadSigner{}
|
||||||
default:
|
default:
|
||||||
|
|
@ -61,12 +61,12 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
|
||||||
// Use this in transaction-handling code where the current block number is unknown. If you
|
// Use this in transaction-handling code where the current block number is unknown. If you
|
||||||
// have the current block number available, use MakeSigner instead.
|
// have the current block number available, use MakeSigner instead.
|
||||||
func LatestSigner(config *params.ChainConfig) Signer {
|
func LatestSigner(config *params.ChainConfig) Signer {
|
||||||
if config.ChainId != nil {
|
if config.ChainID != nil {
|
||||||
if common.Eip1559Block.Uint64() != 9999999999 || config.Eip1559Block != nil {
|
if common.Eip1559Block.Uint64() != 9999999999 || config.Eip1559Block != nil {
|
||||||
return NewLondonSigner(config.ChainId)
|
return NewLondonSigner(config.ChainID)
|
||||||
}
|
}
|
||||||
if config.EIP155Block != nil {
|
if config.EIP155Block != nil {
|
||||||
return NewEIP155Signer(config.ChainId)
|
return NewEIP155Signer(config.ChainID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HomesteadSigner{}
|
return HomesteadSigner{}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ func enable1344(jt *JumpTable) {
|
||||||
|
|
||||||
// opChainID implements CHAINID opcode
|
// opChainID implements CHAINID opcode
|
||||||
func opChainID(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opChainID(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
chainId, _ := uint256.FromBig(interpreter.evm.chainConfig.ChainId)
|
chainId, _ := uint256.FromBig(interpreter.evm.chainConfig.ChainID)
|
||||||
scope.Stack.push(chainId)
|
scope.Stack.push(chainId)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ type Config struct {
|
||||||
func setDefaults(cfg *Config) {
|
func setDefaults(cfg *Config) {
|
||||||
if cfg.ChainConfig == nil {
|
if cfg.ChainConfig == nil {
|
||||||
cfg.ChainConfig = ¶ms.ChainConfig{
|
cfg.ChainConfig = ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: new(big.Int),
|
HomesteadBlock: new(big.Int),
|
||||||
DAOForkBlock: new(big.Int),
|
DAOForkBlock: new(big.Int),
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ func benchmarkEVM_Create(bench *testing.B, code string) {
|
||||||
Coinbase: common.Address{},
|
Coinbase: common.Address{},
|
||||||
BlockNumber: new(big.Int).SetUint64(1),
|
BlockNumber: new(big.Int).SetUint64(1),
|
||||||
ChainConfig: ¶ms.ChainConfig{
|
ChainConfig: ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: new(big.Int),
|
HomesteadBlock: new(big.Int),
|
||||||
ByzantiumBlock: new(big.Int),
|
ByzantiumBlock: new(big.Int),
|
||||||
ConstantinopleBlock: new(big.Int),
|
ConstantinopleBlock: new(big.Int),
|
||||||
|
|
|
||||||
|
|
@ -530,7 +530,7 @@ func (api *DebugAPI) getModifiedAccounts(startBlock, endBlock *types.Block) ([]c
|
||||||
func (api *EthereumAPI) ChainId() hexutil.Uint64 {
|
func (api *EthereumAPI) ChainId() hexutil.Uint64 {
|
||||||
chainID := new(big.Int)
|
chainID := new(big.Int)
|
||||||
if config := api.e.chainConfig; config.IsEIP155(api.e.blockchain.CurrentBlock().Number()) {
|
if config := api.e.chainConfig; config.IsEIP155(api.e.blockchain.CurrentBlock().Number()) {
|
||||||
chainID = config.ChainId
|
chainID = config.ChainID
|
||||||
}
|
}
|
||||||
return (hexutil.Uint64)(chainID.Uint64())
|
return (hexutil.Uint64)(chainID.Uint64())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ func New(stack *node.Node, config *ethconfig.Config, XDCXServ *XDCx.XDCX, lendin
|
||||||
|
|
||||||
networkID := config.NetworkId
|
networkID := config.NetworkId
|
||||||
if networkID == 0 {
|
if networkID == 0 {
|
||||||
networkID = chainConfig.ChainId.Uint64()
|
networkID = chainConfig.ChainID.Uint64()
|
||||||
}
|
}
|
||||||
common.CopyConstants(networkID)
|
common.CopyConstants(networkID)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ func newTestBackend(t *testing.T, eip1559Block *big.Int, pending bool) *testBack
|
||||||
var txdata types.TxData
|
var txdata types.TxData
|
||||||
if eip1559Block != nil && b.Number().Cmp(eip1559Block) >= 0 {
|
if eip1559Block != nil && b.Number().Cmp(eip1559Block) >= 0 {
|
||||||
txdata = &types.DynamicFeeTx{
|
txdata = &types.DynamicFeeTx{
|
||||||
ChainID: gspec.Config.ChainId,
|
ChainID: gspec.Config.ChainID,
|
||||||
Nonce: b.TxNonce(addr),
|
Nonce: b.TxNonce(addr),
|
||||||
To: &common.Address{},
|
To: &common.Address{},
|
||||||
Gas: 30000,
|
Gas: 30000,
|
||||||
|
|
|
||||||
|
|
@ -820,7 +820,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc
|
||||||
config.BlockOverrides.Apply(&vmctx)
|
config.BlockOverrides.Apply(&vmctx)
|
||||||
}
|
}
|
||||||
// Execute the trace
|
// Execute the trace
|
||||||
if err := args.CallDefaults(api.backend.RPCGasCap(), vmctx.BaseFee, api.backend.ChainConfig().ChainId); err != nil {
|
if err := args.CallDefaults(api.backend.RPCGasCap(), vmctx.BaseFee, api.backend.ChainConfig().ChainID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ func TestNoStepExec(t *testing.T) {
|
||||||
|
|
||||||
func TestIsPrecompile(t *testing.T) {
|
func TestIsPrecompile(t *testing.T) {
|
||||||
chaincfg := ¶ms.ChainConfig{
|
chaincfg := ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ func NewBlockChainAPI(b Backend, chainReader consensus.ChainReader) *BlockChainA
|
||||||
|
|
||||||
// ChainId returns the chainID value for transaction replay protection.
|
// ChainId returns the chainID value for transaction replay protection.
|
||||||
func (s *BlockChainAPI) ChainId() *hexutil.Big {
|
func (s *BlockChainAPI) ChainId() *hexutil.Big {
|
||||||
return (*hexutil.Big)(s.b.ChainConfig().ChainId)
|
return (*hexutil.Big)(s.b.ChainConfig().ChainID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockNumber returns the block number of the chain head.
|
// BlockNumber returns the block number of the chain head.
|
||||||
|
|
@ -1159,7 +1159,7 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash
|
||||||
if blockOverrides != nil {
|
if blockOverrides != nil {
|
||||||
blockOverrides.Apply(&blockCtx)
|
blockOverrides.Apply(&blockCtx)
|
||||||
}
|
}
|
||||||
if err := args.CallDefaults(globalGasCap, blockCtx.BaseFee, b.ChainConfig().ChainId); err != nil {
|
if err := args.CallDefaults(globalGasCap, blockCtx.BaseFee, b.ChainConfig().ChainID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
msg := args.ToMessage(b, blockCtx.BaseFee)
|
msg := args.ToMessage(b, blockCtx.BaseFee)
|
||||||
|
|
@ -2029,7 +2029,7 @@ func (s *TransactionAPI) sign(addr common.Address, tx *types.Transaction) (*type
|
||||||
// Request the wallet to sign the transaction
|
// Request the wallet to sign the transaction
|
||||||
var chainID *big.Int
|
var chainID *big.Int
|
||||||
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
|
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
|
||||||
chainID = config.ChainId
|
chainID = config.ChainID
|
||||||
}
|
}
|
||||||
return wallet.SignTx(account, tx, chainID)
|
return wallet.SignTx(account, tx, chainID)
|
||||||
}
|
}
|
||||||
|
|
@ -2115,7 +2115,7 @@ func (s *TransactionAPI) SendTransaction(ctx context.Context, args TransactionAr
|
||||||
|
|
||||||
var chainID *big.Int
|
var chainID *big.Int
|
||||||
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
|
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
|
||||||
chainID = config.ChainId
|
chainID = config.ChainID
|
||||||
}
|
}
|
||||||
signed, err := wallet.SignTx(account, tx, chainID)
|
signed, err := wallet.SignTx(account, tx, chainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend, skipGas
|
||||||
|
|
||||||
// If chain id is provided, ensure it matches the local chain id. Otherwise, set the local
|
// If chain id is provided, ensure it matches the local chain id. Otherwise, set the local
|
||||||
// chain id as the default.
|
// chain id as the default.
|
||||||
want := b.ChainConfig().ChainId
|
want := b.ChainConfig().ChainID
|
||||||
if args.ChainID != nil {
|
if args.ChainID != nil {
|
||||||
if have := (*big.Int)(args.ChainID); have.Cmp(want) != 0 {
|
if have := (*big.Int)(args.ChainID); have.Cmp(want) != 0 {
|
||||||
return fmt.Errorf("chainId does not match node's (have=%v, want=%v)", have, want)
|
return fmt.Errorf("chainId does not match node's (have=%v, want=%v)", have, want)
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ type backendMock struct {
|
||||||
|
|
||||||
func newBackendMock() *backendMock {
|
func newBackendMock() *backendMock {
|
||||||
config := ¶ms.ChainConfig{
|
config := ¶ms.ChainConfig{
|
||||||
ChainId: big.NewInt(42),
|
ChainID: big.NewInt(42),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
|
|
|
||||||
|
|
@ -780,7 +780,7 @@ func (w *worker) commitNewWork() {
|
||||||
}
|
}
|
||||||
nonce := work.state.GetNonce(w.coinbase)
|
nonce := work.state.GetNonce(w.coinbase)
|
||||||
tx := types.NewTransaction(nonce, common.XDCXAddrBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), txMatchBytes)
|
tx := types.NewTransaction(nonce, common.XDCXAddrBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), txMatchBytes)
|
||||||
txM, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, tx, w.config.ChainId)
|
txM, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, tx, w.config.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create tx matches", "error", err)
|
log.Error("Fail to create tx matches", "error", err)
|
||||||
return
|
return
|
||||||
|
|
@ -810,7 +810,7 @@ func (w *worker) commitNewWork() {
|
||||||
}
|
}
|
||||||
nonce := work.state.GetNonce(w.coinbase)
|
nonce := work.state.GetNonce(w.coinbase)
|
||||||
lendingTx := types.NewTransaction(nonce, common.XDCXLendingAddressBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), lendingDataBytes)
|
lendingTx := types.NewTransaction(nonce, common.XDCXLendingAddressBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), lendingDataBytes)
|
||||||
signedLendingTx, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, lendingTx, w.config.ChainId)
|
signedLendingTx, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, lendingTx, w.config.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create lending tx", "error", err)
|
log.Error("Fail to create lending tx", "error", err)
|
||||||
return
|
return
|
||||||
|
|
@ -834,7 +834,7 @@ func (w *worker) commitNewWork() {
|
||||||
}
|
}
|
||||||
nonce := work.state.GetNonce(w.coinbase)
|
nonce := work.state.GetNonce(w.coinbase)
|
||||||
finalizedTx := types.NewTransaction(nonce, common.XDCXLendingFinalizedTradeAddressBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), finalizedTradeData)
|
finalizedTx := types.NewTransaction(nonce, common.XDCXLendingFinalizedTradeAddressBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), finalizedTradeData)
|
||||||
signedFinalizedTx, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, finalizedTx, w.config.ChainId)
|
signedFinalizedTx, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, finalizedTx, w.config.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create lending tx", "error", err)
|
log.Error("Fail to create lending tx", "error", err)
|
||||||
return
|
return
|
||||||
|
|
@ -853,7 +853,7 @@ func (w *worker) commitNewWork() {
|
||||||
LendingStateRoot := work.lendingState.IntermediateRoot()
|
LendingStateRoot := work.lendingState.IntermediateRoot()
|
||||||
txData := append(XDCxStateRoot.Bytes(), LendingStateRoot.Bytes()...)
|
txData := append(XDCxStateRoot.Bytes(), LendingStateRoot.Bytes()...)
|
||||||
tx := types.NewTransaction(work.state.GetNonce(w.coinbase), common.TradingStateAddrBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), txData)
|
tx := types.NewTransaction(work.state.GetNonce(w.coinbase), common.TradingStateAddrBinary, big.NewInt(0), txMatchGasLimit, big.NewInt(0), txData)
|
||||||
txStateRoot, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, tx, w.config.ChainId)
|
txStateRoot, err := wallet.SignTx(accounts.Account{Address: w.coinbase}, tx, w.config.ChainID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to create tx state root", "error", err)
|
log.Error("Fail to create tx state root", "error", err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ var (
|
||||||
|
|
||||||
// XDPoSChain mainnet config
|
// XDPoSChain mainnet config
|
||||||
XDCMainnetChainConfig = &ChainConfig{
|
XDCMainnetChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(50),
|
ChainID: big.NewInt(50),
|
||||||
HomesteadBlock: big.NewInt(1),
|
HomesteadBlock: big.NewInt(1),
|
||||||
EIP150Block: big.NewInt(2),
|
EIP150Block: big.NewInt(2),
|
||||||
EIP155Block: big.NewInt(3),
|
EIP155Block: big.NewInt(3),
|
||||||
|
|
@ -248,7 +248,7 @@ var (
|
||||||
|
|
||||||
// MainnetChainConfig is the chain parameters to run a node on the main network.
|
// MainnetChainConfig is the chain parameters to run a node on the main network.
|
||||||
MainnetChainConfig = &ChainConfig{
|
MainnetChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(1150000),
|
HomesteadBlock: big.NewInt(1150000),
|
||||||
DAOForkBlock: big.NewInt(1920000),
|
DAOForkBlock: big.NewInt(1920000),
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
|
|
@ -262,7 +262,7 @@ var (
|
||||||
|
|
||||||
// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
||||||
TestnetChainConfig = &ChainConfig{
|
TestnetChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(51),
|
ChainID: big.NewInt(51),
|
||||||
HomesteadBlock: big.NewInt(1),
|
HomesteadBlock: big.NewInt(1),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -289,7 +289,7 @@ var (
|
||||||
|
|
||||||
// DevnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
// DevnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
||||||
DevnetChainConfig = &ChainConfig{
|
DevnetChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(551),
|
ChainID: big.NewInt(551),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
|
|
@ -317,7 +317,7 @@ var (
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllEthashProtocolChanges = &ChainConfig{
|
AllEthashProtocolChanges = &ChainConfig{
|
||||||
ChainId: big.NewInt(1337),
|
ChainID: big.NewInt(1337),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -337,7 +337,7 @@ var (
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllXDPoSProtocolChanges = &ChainConfig{
|
AllXDPoSProtocolChanges = &ChainConfig{
|
||||||
ChainId: big.NewInt(89),
|
ChainID: big.NewInt(89),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -352,7 +352,7 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
AllCliqueProtocolChanges = &ChainConfig{
|
AllCliqueProtocolChanges = &ChainConfig{
|
||||||
ChainId: big.NewInt(1337),
|
ChainID: big.NewInt(1337),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -368,7 +368,7 @@ var (
|
||||||
|
|
||||||
// XDPoS config with v2 engine after block 901
|
// XDPoS config with v2 engine after block 901
|
||||||
TestXDPoSMockChainConfig = &ChainConfig{
|
TestXDPoSMockChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(1337),
|
ChainID: big.NewInt(1337),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -395,7 +395,7 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
TestChainConfig = &ChainConfig{
|
TestChainConfig = &ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: false,
|
DAOForkSupport: false,
|
||||||
|
|
@ -417,7 +417,7 @@ var (
|
||||||
// that any network, identified by its genesis block, can have its own
|
// that any network, identified by its genesis block, can have its own
|
||||||
// set of configuration options.
|
// set of configuration options.
|
||||||
type ChainConfig struct {
|
type ChainConfig struct {
|
||||||
ChainId *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection
|
ChainID *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection
|
||||||
|
|
||||||
HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead)
|
HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead)
|
||||||
|
|
||||||
|
|
@ -676,7 +676,7 @@ func (c *ChainConfig) Description() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var banner = "Chain configuration:\n"
|
var banner = "Chain configuration:\n"
|
||||||
banner += fmt.Sprintf(" - ChainID: %-8v\n", c.ChainId)
|
banner += fmt.Sprintf(" - ChainID: %-8v\n", c.ChainID)
|
||||||
banner += fmt.Sprintf(" - Homestead: %-8v\n", c.HomesteadBlock)
|
banner += fmt.Sprintf(" - Homestead: %-8v\n", c.HomesteadBlock)
|
||||||
banner += fmt.Sprintf(" - DAO Fork: %-8v\n", c.DAOForkBlock)
|
banner += fmt.Sprintf(" - DAO Fork: %-8v\n", c.DAOForkBlock)
|
||||||
banner += fmt.Sprintf(" - DAO Support: %-8v\n", c.DAOForkSupport)
|
banner += fmt.Sprintf(" - DAO Support: %-8v\n", c.DAOForkSupport)
|
||||||
|
|
@ -880,7 +880,7 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
||||||
if isForkIncompatible(c.EIP158Block, newcfg.EIP158Block, head) {
|
if isForkIncompatible(c.EIP158Block, newcfg.EIP158Block, head) {
|
||||||
return newCompatError("EIP158 fork block", c.EIP158Block, newcfg.EIP158Block)
|
return newCompatError("EIP158 fork block", c.EIP158Block, newcfg.EIP158Block)
|
||||||
}
|
}
|
||||||
if c.IsEIP158(head) && !configNumEqual(c.ChainId, newcfg.ChainId) {
|
if c.IsEIP158(head) && !configNumEqual(c.ChainID, newcfg.ChainID) {
|
||||||
return newCompatError("EIP158 chain ID", c.EIP158Block, newcfg.EIP158Block)
|
return newCompatError("EIP158 chain ID", c.EIP158Block, newcfg.EIP158Block)
|
||||||
}
|
}
|
||||||
if isForkIncompatible(c.ByzantiumBlock, newcfg.ByzantiumBlock, head) {
|
if isForkIncompatible(c.ByzantiumBlock, newcfg.ByzantiumBlock, head) {
|
||||||
|
|
@ -986,7 +986,7 @@ type Rules struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChainConfig) Rules(num *big.Int) Rules {
|
func (c *ChainConfig) Rules(num *big.Int) Rules {
|
||||||
chainId := c.ChainId
|
chainId := c.ChainID
|
||||||
if chainId == nil {
|
if chainId == nil {
|
||||||
chainId = new(big.Int)
|
chainId = new(big.Int)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
mainnetChainConfig = params.ChainConfig{
|
mainnetChainConfig = params.ChainConfig{
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(1150000),
|
HomesteadBlock: big.NewInt(1150000),
|
||||||
DAOForkBlock: big.NewInt(1920000),
|
DAOForkBlock: big.NewInt(1920000),
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
|
|
|
||||||
|
|
@ -26,26 +26,26 @@ import (
|
||||||
// This table defines supported forks and their chain config.
|
// This table defines supported forks and their chain config.
|
||||||
var Forks = map[string]*params.ChainConfig{
|
var Forks = map[string]*params.ChainConfig{
|
||||||
"Frontier": {
|
"Frontier": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
},
|
},
|
||||||
"Homestead": {
|
"Homestead": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
},
|
},
|
||||||
"EIP150": {
|
"EIP150": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
},
|
},
|
||||||
"EIP158": {
|
"EIP158": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
EIP158Block: big.NewInt(0),
|
EIP158Block: big.NewInt(0),
|
||||||
},
|
},
|
||||||
"Byzantium": {
|
"Byzantium": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
|
|
@ -54,22 +54,22 @@ var Forks = map[string]*params.ChainConfig{
|
||||||
ByzantiumBlock: big.NewInt(0),
|
ByzantiumBlock: big.NewInt(0),
|
||||||
},
|
},
|
||||||
"FrontierToHomesteadAt5": {
|
"FrontierToHomesteadAt5": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(5),
|
HomesteadBlock: big.NewInt(5),
|
||||||
},
|
},
|
||||||
"HomesteadToEIP150At5": {
|
"HomesteadToEIP150At5": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(5),
|
EIP150Block: big.NewInt(5),
|
||||||
},
|
},
|
||||||
"HomesteadToDaoAt5": {
|
"HomesteadToDaoAt5": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: big.NewInt(5),
|
DAOForkBlock: big.NewInt(5),
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
},
|
},
|
||||||
"EIP158ToByzantiumAt5": {
|
"EIP158ToByzantiumAt5": {
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ func TestTransaction(t *testing.T) {
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
EIP158Block: big.NewInt(0),
|
EIP158Block: big.NewInt(0),
|
||||||
ChainId: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
})
|
})
|
||||||
txt.config(`^Byzantium/`, params.ChainConfig{
|
txt.config(`^Byzantium/`, params.ChainConfig{
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue