swarm/network: Rename misleadingly named method

(amend commit to trigger ci - attempt 5)
This commit is contained in:
lash 2019-03-22 16:05:37 +01:00
parent ac569871ad
commit 4d6fdb5e5d
2 changed files with 4 additions and 4 deletions

View file

@ -112,7 +112,7 @@ func (s *Simulation) AddNode(opts ...AddNodeOption) (id enode.ID, err error) {
// for now we have no way of setting bootnodes or lightnodes in sims
// so we just let them be set to false
// they should perhaps be possible to override them with AddNodeOption
bzzPrivateKey, err := BzzKeyFromConfig(conf)
bzzPrivateKey, err := BzzPrivateKeyFromConfig(conf)
if err != nil {
return enode.ID{}, err
}
@ -330,7 +330,7 @@ func init() {
// derive a private key for swarm for the node key
// returns the private key used to generate the bzz key
func BzzKeyFromConfig(conf *adapters.NodeConfig) (*ecdsa.PrivateKey, error) {
func BzzPrivateKeyFromConfig(conf *adapters.NodeConfig) (*ecdsa.PrivateKey, error) {
// pad the seed key some arbitrary data as ecdsa.GenerateKey takes 40 bytes seed data
privKeyBuf := append(crypto.FromECDSA(conf.PrivateKey), []byte{0x62, 0x7a, 0x7a, 0x62, 0x7a, 0x7a, 0x62, 0x7a}...)
bzzPrivateKey, err := ecdsa.GenerateKey(crypto.S256(), bytes.NewReader(privKeyBuf))

View file

@ -402,7 +402,7 @@ func newProxServices(tstdata *testData, allowRaw bool, handlerContextFuncs map[T
// if the translation in the network package changes, that can cause these tests to unpredictably fail
// therefore we keep a local copy of the translation here
addr := network.NewAddr(ctx.Config.Node())
bzzPrivateKey, err = simulation.BzzKeyFromConfig(ctx.Config)
bzzPrivateKey, err = simulation.BzzPrivateKeyFromConfig(ctx.Config)
if err != nil {
return nil, nil, err
}
@ -428,7 +428,7 @@ func newProxServices(tstdata *testData, allowRaw bool, handlerContextFuncs map[T
privkey, err := w.GetPrivateKey(keys)
pssp := NewPssParams().WithPrivateKey(privkey)
pssp.AllowRaw = allowRaw
bzzPrivateKey, err := simulation.BzzKeyFromConfig(ctx.Config)
bzzPrivateKey, err := simulation.BzzPrivateKeyFromConfig(ctx.Config)
if err != nil {
return nil, nil, err
}