Skip to content

Commit

Permalink
add : amoy genesis hash
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsharma committed Nov 8, 2023
1 parent 903f1e2 commit 7e85f0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ func minAgeFilter(args []string) (nodeFilter, error) {
return f, nil
}

// TODO : 0xSharma : Add amoy genesis hash

func ethFilter(args []string) (nodeFilter, error) {
var filter forkid.Filter

Expand All @@ -268,6 +266,8 @@ func ethFilter(args []string) (nodeFilter, error) {
filter = forkid.NewStaticFilter(params.SepoliaChainConfig, params.SepoliaGenesisHash)
case "bor-mumbai":
filter = forkid.NewStaticFilter(params.MumbaiChainConfig, params.MumbaiGenesisHash)
case "bor-amoy":
filter = forkid.NewStaticFilter(params.AmoyChainConfig, params.AmoyGenesisHash)
case "bor-mainnet":
filter = forkid.NewStaticFilter(params.BorMainnetChainConfig, params.BorMainnetGenesisHash)
default:
Expand Down
4 changes: 2 additions & 2 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ func LoadCliqueConfig(db ethdb.Database, genesis *Genesis) (*params.CliqueConfig
return nil, nil
}

// TODO : 0xSharma : add : Amoy Genesis Hash

func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
switch {
case g != nil:
Expand All @@ -482,6 +480,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.GoerliChainConfig
case ghash == params.MumbaiGenesisHash:
return params.MumbaiChainConfig
case ghash == params.AmoyGenesisHash:
return params.AmoyChainConfig

Check warning on line 484 in core/genesis.go

View check run for this annotation

Codecov / codecov/patch

core/genesis.go#L483-L484

Added lines #L483 - L484 were not covered by tests
case ghash == params.BorMainnetGenesisHash:
return params.BorMainnetChainConfig
case ghash == params.KilnGenesisHash:
Expand Down
2 changes: 2 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string {
net = "goerli"
case MumbaiGenesisHash:
net = "mumbai"
case AmoyGenesisHash:
net = "amoy"

Check warning on line 129 in params/bootnodes.go

View check run for this annotation

Codecov / codecov/patch

params/bootnodes.go#L128-L129

Added lines #L128 - L129 were not covered by tests
case BorMainnetGenesisHash:
net = "bor-mainnet"
case SepoliaGenesisHash:
Expand Down
3 changes: 1 addition & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ var (
RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177")
GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
MumbaiGenesisHash = common.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7")
AmoyGenesisHash = common.HexToHash("0xe5f6dea6c2596750f51f12caf61fdda0bd95ae81d0783c22ca7adb481320b9e6")
BorMainnetGenesisHash = common.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b")
KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8")
)

// TODO : 0xSharma : Add BorAmoyGenesisHash

// TrustedCheckpoints associates each known checkpoint with the genesis hash of
// the chain it belongs to.
var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{
Expand Down

0 comments on commit 7e85f0e

Please sign in to comment.