mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-08 21:48:05 -05:00
Catch missing configuration value.
This commit is contained in:
@@ -46,9 +46,15 @@ func Network(ctx context.Context, eth2Client eth2client.Service) (string, error)
|
||||
} else if provider, isProvider := eth2Client.(eth2client.SpecProvider); isProvider {
|
||||
config, err := provider.Spec(ctx)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to obtain deposit contract address")
|
||||
return "", errors.Wrap(err, "failed to obtain chain specification")
|
||||
}
|
||||
if config == nil {
|
||||
return "", errors.New("failed to return chain specification")
|
||||
}
|
||||
depositContractAddress, exists := config["DEPOSIT_CONTRACT_ADDRESS"]
|
||||
if exists {
|
||||
address = depositContractAddress.([]byte)
|
||||
}
|
||||
address = config["DEPOSIT_CONTRACT_ADDRESS"].([]byte)
|
||||
}
|
||||
|
||||
return network(address), nil
|
||||
|
||||
Reference in New Issue
Block a user