drop hardcoded /Users/z paths — use $HOME-relative

This commit is contained in:
2026-05-21 15:01:37 -07:00
parent c9dda742a6
commit 9496a692ed
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ import (
// TestLuxGenesisFromJSON builds the genesis block from cchain.json and compares
// hash + RLP bytes to the genesis recovered from the canonical RLP file.
func TestLuxGenesisFromJSON(t *testing.T) {
cchainPath := "/Users/z/work/lux/genesis/configs/mainnet/cchain.json"
rlpPath := "/Users/z/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp"
cchainPath := os.ExpandEnv("$HOME/work/lux/genesis/configs/mainnet/cchain.json")
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp")
for _, p := range []string{cchainPath, rlpPath} {
if _, err := os.Stat(p); os.IsNotExist(err) {
+6 -6
View File
@@ -29,7 +29,7 @@ var (
// TestLuxGenesisHashFromRLP verifies that the Lux C-chain genesis block
// can be decoded from RLP and maintains the correct hash.
func TestLuxGenesisHashFromRLP(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Lux RLP file not found at %s, skipping test", rlpPath)
@@ -76,7 +76,7 @@ func TestLuxGenesisHashFromRLP(t *testing.T) {
// TestZooGenesisHashFromRLP verifies that the Zoo genesis block
// can be decoded from RLP and maintains the correct hash.
func TestZooGenesisHashFromRLP(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Zoo RLP file not found at %s, skipping test", rlpPath)
@@ -129,7 +129,7 @@ func TestZooGenesisHashFromRLP(t *testing.T) {
// TestBlockHashPreservationAfterDecode verifies that blocks maintain
// their hashes after decode, re-encode, and re-decode cycles.
func TestBlockHashPreservationAfterDecode(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Zoo RLP file not found at %s, skipping test", rlpPath)
@@ -180,7 +180,7 @@ func TestBlockHashPreservationAfterDecode(t *testing.T) {
// TestStateRootChainThroughZooBlocks verifies that state roots form a valid chain
// and are properly preserved through decode operations.
func TestStateRootChainThroughZooBlocks(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Zoo RLP file not found at %s, skipping test", rlpPath)
@@ -277,7 +277,7 @@ func TestStateRootChainThroughZooBlocks(t *testing.T) {
// TestStateRootRoundtripZoo verifies state roots survive encode/decode cycles
func TestStateRootRoundtripZoo(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Zoo RLP file not found at %s, skipping test", rlpPath)
@@ -335,7 +335,7 @@ func TestStateRootRoundtripZoo(t *testing.T) {
// TestStateRootChainThroughLuxBlocks verifies state roots through Lux C-chain blocks
func TestStateRootChainThroughLuxBlocks(t *testing.T) {
rlpPath := "/Users/z/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp"
rlpPath := os.ExpandEnv("$HOME/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp")
if _, err := os.Stat(rlpPath); os.IsNotExist(err) {
t.Skipf("Lux RLP file not found at %s, skipping test", rlpPath)
+2 -2
View File
@@ -18,7 +18,7 @@ import (
func TestRLPImportZooMainnet(t *testing.T) {
rlpPath := os.Getenv("ZOO_RLP_PATH")
if rlpPath == "" {
rlpPath = "/Users/z/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp"
rlpPath = os.ExpandEnv("$HOME/work/lux/state/rlp/zoo-mainnet/zoo-mainnet-200200.rlp")
}
// Check if file exists
@@ -125,7 +125,7 @@ func verifyBlockDecode(t *testing.T, block *types.Block, blockNum int) {
func TestRLPImportLuxMainnetSample(t *testing.T) {
rlpPath := os.Getenv("RLP_PATH")
if rlpPath == "" {
rlpPath = "/Users/z/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp"
rlpPath = os.ExpandEnv("$HOME/work/lux/state/rlp/lux-mainnet/lux-mainnet-96369.rlp")
}
// Check if file exists