Added C-chain key for public testnet

This commit is contained in:
StephenButtolph 2020-04-03 16:09:31 -04:00
parent dce704e8f0
commit ea21a56e86
3 changed files with 28 additions and 7 deletions

View File

@ -5,6 +5,7 @@ package genesis
import (
"github.com/ava-labs/gecko/ids"
"github.com/ava-labs/gecko/vms/evm"
)
// Note that since an AVA network has exactly one Platform Chain,
@ -15,8 +16,8 @@ import (
// Config contains the genesis addresses used to construct a genesis
type Config struct {
MintAddresses, FundedAddresses, StakerIDs []string
ParsedMintAddresses, ParsedFundedAddresses, ParsedStakerIDs []ids.ShortID
MintAddresses, FundedAddresses, FundedEVMAddresses, StakerIDs []string
ParsedMintAddresses, ParsedFundedAddresses, ParsedStakerIDs []ids.ShortID
}
func (c *Config) init() error {
@ -65,6 +66,9 @@ var (
"ZdhZv6oZrmXLyFDy6ovXAu6VxmbTsT2h",
"6cesTteH62Y5mLoDBUASaBvCXuL2AthL",
},
FundedEVMAddresses: []string{
"0x572f4D80f10f663B5049F789546f25f70Bb62a7F",
},
StakerIDs: []string{
"NX4zVkuiRJZYe6Nzzav7GXN3TakUet3Co",
"CMsa8cMw4eib1Hb8GG4xiUKAq5eE1BwUX",
@ -79,6 +83,10 @@ var (
// Private key: ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN
"6Y3kysjF9jnHnYkdS9yGAuoHyae2eNmeV",
},
FundedEVMAddresses: []string{
// Private key: evm.GenesisTestKey
evm.GenesisTestAddr,
},
StakerIDs: []string{
"7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
"MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ",

View File

@ -85,6 +85,13 @@ func FromConfig(networkID uint32, config *Config) ([]byte, error) {
if success != true {
return nil, errors.New("problem creating evm genesis state")
}
alloc := core.GenesisAlloc{}
for _, addr := range config.FundedEVMAddresses {
alloc[common.HexToAddress(addr)] = core.GenesisAccount{
Balance: evmBalance,
}
}
evmArgs := core.Genesis{
Config: &params.ChainConfig{
ChainID: big.NewInt(43110),
@ -106,11 +113,7 @@ func FromConfig(networkID uint32, config *Config) ([]byte, error) {
Difficulty: big.NewInt(0),
Mixhash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
Coinbase: common.HexToAddress("0x0000000000000000000000000000000000000000"),
Alloc: core.GenesisAlloc{
common.HexToAddress(evm.GenesisTestAddr): core.GenesisAccount{
Balance: evmBalance,
},
},
Alloc: alloc,
Number: 0,
GasUsed: 0,
ParentHash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),

View File

@ -133,6 +133,16 @@ func TestVMGenesis(t *testing.T) {
vmID: avm.ID,
expectedID: "4R5p2RXDGLqaifZE4hHWH9owe34pfoBULn1DrQTWivjg8o4aH",
},
{
networkID: CascadeID,
vmID: evm.ID,
expectedID: "2mUYSXfLrDtigwbzj1LxKVsHwELghc5sisoXrzJwLqAAQHF4i",
},
{
networkID: LocalID,
vmID: evm.ID,
expectedID: "tZGm6RCkeGpVETUTp11DW3UYFZmm69zfqxchpHrSF7wgy8rmw",
},
}
for _, test := range tests {