Add Callisto Treasury address param

This commit is contained in:
Yohan Graterol 2017-12-14 22:25:51 -05:00
parent 071261edfd
commit a265ec5b13

View file

@ -44,6 +44,20 @@ var (
Ethash: new(EthashConfig), Ethash: new(EthashConfig),
} }
// CallistoMainnetChainConfig contains the chain parameters to run a node on the Callisto Main network.
CallistoMainnetChainConfig = &ChainConfig{
ChainId: big.NewInt(104729),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: big.NewInt(0),
DAOForkSupport: false,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
EIP155Block: big.NewInt(3),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(4),
CallistoBlock: big.NewInt(1),
}
// 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(3), ChainId: big.NewInt(3),
@ -59,7 +73,7 @@ var (
Ethash: new(EthashConfig), Ethash: new(EthashConfig),
} }
// CallistoTestnetChainConfig contains the chain parameters to run a node on the Ropsten test network. // CallistoTestnetChainConfig contains the chain parameters to run a node on the Callisto test network.
CallistoTestnetChainConfig = &ChainConfig{ CallistoTestnetChainConfig = &ChainConfig{
ChainId: big.NewInt(7919), ChainId: big.NewInt(7919),
HomesteadBlock: big.NewInt(0), HomesteadBlock: big.NewInt(0),
@ -101,16 +115,16 @@ 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{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil} AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, new(EthashConfig), nil}
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Clique consensus. // and accepted by the Ethereum core developers into the Clique consensus.
// //
// 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.
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, &CliqueConfig{Period: 0, Epoch: 30000}} AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{},nil, &CliqueConfig{Period: 0, Epoch: 30000}}
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil} TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, new(EthashConfig), nil}
TestRules = TestChainConfig.Rules(new(big.Int)) TestRules = TestChainConfig.Rules(new(big.Int))
) )
@ -137,6 +151,7 @@ type ChainConfig struct {
ByzantiumBlock *big.Int `json:"byzantiumBlock,omitempty"` // Byzantium switch block (nil = no fork, 0 = already on byzantium) ByzantiumBlock *big.Int `json:"byzantiumBlock,omitempty"` // Byzantium switch block (nil = no fork, 0 = already on byzantium)
CallistoBlock *big.Int `json:"callistoBlock,omitempty"` CallistoBlock *big.Int `json:"callistoBlock,omitempty"`
CallistoTreasuryAddress common.Address `json:"callistoTreasuryAddress,omitempty"`
// Various consensus engines // Various consensus engines
Ethash *EthashConfig `json:"ethash,omitempty"` Ethash *EthashConfig `json:"ethash,omitempty"`
Clique *CliqueConfig `json:"clique,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"`
@ -172,7 +187,7 @@ func (c *ChainConfig) String() string {
default: default:
engine = "unknown" engine = "unknown"
} }
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Callisto: %v Engine: %v}", return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Callisto: %v Callisto Treasury Address: %v Engine: %v}",
c.ChainId, c.ChainId,
c.HomesteadBlock, c.HomesteadBlock,
c.DAOForkBlock, c.DAOForkBlock,
@ -182,6 +197,7 @@ func (c *ChainConfig) String() string {
c.EIP158Block, c.EIP158Block,
c.ByzantiumBlock, c.ByzantiumBlock,
c.CallistoBlock, c.CallistoBlock,
c.CallistoTreasuryAddress,
engine, engine,
) )
} }
@ -225,6 +241,8 @@ func (c *ChainConfig) GasTable(num *big.Int) GasTable {
return GasTableHomestead return GasTableHomestead
} }
switch { switch {
case c.IsCallisto(num):
return GasTableCallisto
case c.IsEIP158(num): case c.IsEIP158(num):
return GasTableEIP158 return GasTableEIP158
case c.IsEIP150(num): case c.IsEIP150(num):