Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
zeth.cli.utils.NetworkConfig Class Reference

Public Member Functions

def __init__ (self, str name, str endpoint, Optional[str] certificate=None, bool insecure=False)
 
str to_json (self)
 

Static Public Member Functions

NetworkConfig from_json (str network_config_json)
 

Public Attributes

 name
 
 endpoint
 
 certificate
 
 insecure
 

Detailed Description

Simple description of a network. Name (may be used in some cases to
understand the type of network) and endpoint URL.

Definition at line 27 of file utils.py.

Constructor & Destructor Documentation

◆ __init__()

def zeth.cli.utils.NetworkConfig.__init__ (   self,
str  name,
str  endpoint,
Optional[str]   certificate = None,
bool   insecure = False 
)

Definition at line 32 of file utils.py.

32  def __init__(
33  self,
34  name: str,
35  endpoint: str,
36  certificate: Optional[str] = None,
37  insecure: bool = False):
38  self.name = name
39  self.endpoint = endpoint
40  self.certificate = certificate
41  self.insecure = insecure
42 

Member Function Documentation

◆ from_json()

NetworkConfig zeth.cli.utils.NetworkConfig.from_json ( str  network_config_json)
static

Definition at line 55 of file utils.py.

55  def from_json(network_config_json: str) -> NetworkConfig:
56  json_dict = json.loads(network_config_json)
57  return NetworkConfig(
58  name=json_dict["name"],
59  endpoint=json_dict["endpoint"],
60  certificate=json_dict.get("certificate", None),
61  insecure=json_dict.get("insecure", None))
62 
63 

◆ to_json()

str zeth.cli.utils.NetworkConfig.to_json (   self)

Definition at line 43 of file utils.py.

43  def to_json(self) -> str:
44  json_dict: Dict[str, Any] = {
45  "name": self.name,
46  "endpoint": self.endpoint,
47  }
48  if self.certificate:
49  json_dict["certificate"] = self.certificate
50  if self.insecure:
51  json_dict["insecure"] = self.insecure
52  return json.dumps(json_dict)
53 

Member Data Documentation

◆ certificate

zeth.cli.utils.NetworkConfig.certificate

Definition at line 35 of file utils.py.

◆ endpoint

zeth.cli.utils.NetworkConfig.endpoint

Definition at line 34 of file utils.py.

◆ insecure

zeth.cli.utils.NetworkConfig.insecure

Definition at line 36 of file utils.py.

◆ name

zeth.cli.utils.NetworkConfig.name

Definition at line 33 of file utils.py.


The documentation for this class was generated from the following file: