Skip to content

Commit

Permalink
chore: update mainnet genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlee42 committed Dec 19, 2024
1 parent 420ad01 commit 77bbc29
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
24 changes: 9 additions & 15 deletions core/genesis_goat.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package core

import (
"embed"
"encoding/json"
"math/big"

Expand All @@ -12,19 +11,15 @@ import (
"github.com/ethereum/go-ethereum/params"
)

//go:embed goat
var goatGenesis embed.FS

var goatEmptyExtra = common.Hex2Bytes("0056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")

//go:embed goat/testnet3.json
var goatTestnet3Alloc []byte

// DefaultGoatTestnet3GenesisBlock returns the Goat Testnet3 genesis block.
func DefaultGoatTestnet3GenesisBlock() *Genesis {
raw, err := goatGenesis.ReadFile("goat/testnet3.json")
if err != nil {
panic(err)
}
var alloc types.GenesisAlloc
if err := json.Unmarshal(raw, &alloc); err != nil {
if err := json.Unmarshal(goatTestnet3Alloc, &alloc); err != nil {
panic(err)
}
return &Genesis{
Expand All @@ -39,20 +34,19 @@ func DefaultGoatTestnet3GenesisBlock() *Genesis {
}
}

//go:embed goat/mainnet.json
var goatMainnetAlloc []byte

// DefaultGoatMainnetGenesisBlock returns the Goat Mainnet genesis block.
func DefaultGoatMainnetGenesisBlock() *Genesis {
raw, err := goatGenesis.ReadFile("goat/mainnet.json")
if err != nil {
panic(err)
}
var alloc types.GenesisAlloc
if err := json.Unmarshal(raw, &alloc); err != nil {
if err := json.Unmarshal(goatMainnetAlloc, &alloc); err != nil {
panic(err)
}
return &Genesis{
Config: params.GoatMainnetChainConfig,
Nonce: 0,
Timestamp: 0x674d6b3a,
Timestamp: 0x676419e8,
ExtraData: goatEmptyExtra,
GasLimit: params.GoatTxGasLimit,
Difficulty: common.Big0,
Expand Down
Loading

0 comments on commit 77bbc29

Please sign in to comment.