diff --git a/go.mod b/go.mod index 4984d83..2feb416 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/luxfi/cache v1.2.1 // indirect github.com/luxfi/codec v1.1.4 // indirect github.com/luxfi/geth v1.16.98 // indirect + github.com/luxfi/light v1.0.0 github.com/luxfi/math/big v0.1.0 // indirect github.com/luxfi/metric v1.5.5 // indirect github.com/luxfi/mock v0.1.1 // indirect diff --git a/go.sum b/go.sum index efee05d..8d77dfb 100644 --- a/go.sum +++ b/go.sum @@ -215,3 +215,5 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +github.com/luxfi/light v1.0.0 h1:zTJgp5M0xX8rIwRjYDQgOGhLas3rgXyhkszrTX+ne3s= +github.com/luxfi/light v1.0.0/go.mod h1:1G0kgjEe/srlBMCIrFq4IvhnrMuHKFG18CRUWfw1z30= diff --git a/pkg/genesis/keys.go b/pkg/genesis/keys.go index 837f1f9..a60b6b5 100644 --- a/pkg/genesis/keys.go +++ b/pkg/genesis/keys.go @@ -28,6 +28,7 @@ import ( "github.com/luxfi/go-bip32" "github.com/luxfi/go-bip39" "github.com/luxfi/ids" + "github.com/luxfi/light" "github.com/luxfi/log" luxtls "github.com/luxfi/tls" "golang.org/x/crypto/sha3" @@ -74,7 +75,11 @@ const ( // value of LUX_MNEMONIC to bootstrap a local network (network ID >= // 1337). RefuseLightMnemonicOnProduction enforces it cannot be used // on mainnet/testnet/devnet (network IDs 1/2/3). - LightMnemonic = "light light light light light light light light light light light energy" + // + // Single source of truth: github.com/luxfi/light.Mnemonic. This is a + // backward-compat re-export so existing genesis.LightMnemonic callers + // keep working; do not re-declare the literal here. + LightMnemonic = light.Mnemonic ) // KeyInfo contains parsed key information for a node @@ -574,7 +579,6 @@ func privateKeyToEVMAddress(privKey []byte) (ids.ShortID, error) { return addr, nil } - // keccakBytes returns Keccak256(data) as a []byte slice (saves the // two-step assignment-then-slice that Go requires for function-returned // arrays). @@ -1123,4 +1127,3 @@ func buildConfigFromKeyInfos(networkID uint32, validatorKeys []KeyInfo, allKeys Message: genesisMessage(networkID), }, nil } -