Skip to content

Commit

Permalink
add suport for holesky
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Oct 11, 2023
1 parent 4bd935e commit 40dfd23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions master_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ func TestMasterKey(t *testing.T) {

buf, err = master.DeriveChild(fmt.Sprintf("m/%v", i))
assert.Nil(t, err)

cred, err = NewCredential(buf, 0, nil, PyrmontSetting)
assert.Nil(t, err)
text, err = cred.MarshalText()
assert.Nil(t, err)
t.Log("pyrmont:", string(text))

cred, err = NewCredential(buf, 0, nil, HoleskySetting)
assert.Nil(t, err)
text, err = cred.MarshalText()
assert.Nil(t, err)
t.Log("holesky:", string(text))

buf.Destroy()
}
}
6 changes: 6 additions & 0 deletions settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const (
MAINNET = "mainnet"
PYRMONT = "pyrmont"
PRATER = "prater"
HOLESKY = "holesky"
)

var (
MainnetSetting BaseChainSetting
PyrmontSetting BaseChainSetting
PraterSetting BaseChainSetting
HoleskySetting BaseChainSetting
)

func init() {
Expand All @@ -35,4 +37,8 @@ func init() {
// Eth2 testnet (spec v1.0.1)
PraterSetting.ETH2_NETWORK_NAME = PRATER
binary.BigEndian.PutUint32(PraterSetting.GENESIS_FORK_VERSION[:], 0x00001020)

// Holesky setting
HoleskySetting.ETH2_NETWORK_NAME = HOLESKY
binary.BigEndian.PutUint32(HoleskySetting.GENESIS_FORK_VERSION[:], 0x01017000)
}

0 comments on commit 40dfd23

Please sign in to comment.