Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Classes | Functions
zeth.cli.utils Namespace Reference

Classes

class  ClientConfig
 
class  MixerDescription
 
class  NetworkConfig
 

Functions

NetworkConfig get_eth_network (Optional[str] eth_network)
 
Any open_web3_from_network (NetworkConfig eth_net)
 
str load_contract_address (str contract_addr)
 
Any open_web3_from_ctx (ClientConfig ctx)
 
Dict[str, Any] get_erc20_abi ()
 
InstanceDescription get_erc20_instance_description (str token_address)
 
None write_mixer_description (str mixer_desc_file, MixerDescription mixer_desc)
 
MixerDescription load_mixer_description (str mixer_desc_file)
 
MixerDescription load_mixer_description_from_ctx (ClientConfig ctx)
 
str get_zeth_address_file (ClientConfig ctx)
 
ZethAddressPub load_zeth_address_public (ClientConfig ctx)
 
None write_zeth_address_public (ZethAddressPub pub_addr, str pub_addr_file)
 
ZethAddressPriv load_zeth_address_secret (ClientConfig ctx)
 
None write_zeth_address_secret (ZethAddressPriv secret_addr, str addr_file)
 
ZethAddress load_zeth_address (ClientConfig ctx)
 
Wallet open_wallet (Any mixer_instance, ZethAddressPriv js_secret, ClientConfig ctx)
 
int do_sync (Any web3, Wallet wallet, PairingParameters pp, Optional[str] wait_tx, Optional[Callable[[ZethNoteDescription], None]] callback=None, Optional[int] batch_size=None)
 
str pub_address_file (str addr_file)
 
str find_pub_address_file (str base_file)
 
ProverClient create_prover_client (ClientConfig ctx)
 
MixerClient create_mixer_client (ClientConfig ctx, Optional[ProverClient] prover_client=None)
 
Tuple[MixerClient, MixerDescriptioncreate_mixer_client_and_mixer_desc (ClientConfig ctx, Optional[ProverClient] prover_client=None)
 
str zeth_note_short (ZethNoteDescription note_desc)
 
None zeth_note_short_print (ZethNoteDescription note_desc)
 
Tuple[ZethAddressPub, EtherValueparse_output (str output_str)
 
str load_eth_address (Optional[str] eth_addr)
 
None write_eth_address (str eth_addr, str eth_addr_file)
 
Optional[bytes] load_eth_private_key (Optional[str] private_key_file)
 
None write_eth_private_key (bytes private_key, str private_key_file)
 

Function Documentation

◆ create_mixer_client()

MixerClient zeth.cli.utils.create_mixer_client ( ClientConfig  ctx,
Optional[ProverClient]   prover_client = None 
)
Create a MixerClient for an existing deployment.

Definition at line 381 of file utils.py.

382  ctx: ClientConfig,
383  prover_client: Optional[ProverClient] = None) -> MixerClient:
384  """
385  Create a MixerClient for an existing deployment.
386  """
387  mixer_client, _ = create_mixer_client_and_mixer_desc(ctx, prover_client)
388  return mixer_client
389 
390 
Here is the call graph for this function:

◆ create_mixer_client_and_mixer_desc()

Tuple[MixerClient, MixerDescription] zeth.cli.utils.create_mixer_client_and_mixer_desc ( ClientConfig  ctx,
Optional[ProverClient]   prover_client = None 
)
Create a MixerClient and MixerDescription object, for an existing deployment.

Definition at line 391 of file utils.py.

392  ctx: ClientConfig,
393  prover_client: Optional[ProverClient] = None
394 ) -> Tuple[MixerClient, MixerDescription]:
395  """
396  Create a MixerClient and MixerDescription object, for an existing deployment.
397  """
398  web3 = open_web3_from_ctx(ctx)
399  mixer_desc = load_mixer_description_from_ctx(ctx)
400  mixer_instance = mixer_desc.mixer.instantiate(web3)
401  if prover_client is None:
402  prover_client = create_prover_client(ctx)
403  prover_config = prover_client.get_configuration()
404  mixer_client = MixerClient(web3, prover_config, mixer_instance)
405  return (mixer_client, mixer_desc)
406 
407 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_prover_client()

ProverClient zeth.cli.utils.create_prover_client ( ClientConfig  ctx)
Create a prover client using the settings from the commands context.

Definition at line 373 of file utils.py.

373 def create_prover_client(ctx: ClientConfig) -> ProverClient:
374  """
375  Create a prover client using the settings from the commands context.
376  """
377  return ProverClient(
378  ctx.prover_server_endpoint, ctx.prover_config_file)
379 
380 
Here is the caller graph for this function:

◆ do_sync()

int zeth.cli.utils.do_sync ( Any  web3,
Wallet  wallet,
PairingParameters  pp,
Optional[str]  wait_tx,
Optional[Callable[[ZethNoteDescription], None]]   callback = None,
Optional[int]   batch_size = None 
)
Implementation of sync, reused by several commands.  Returns the
block_number synced to.  Also updates and saves the MerkleTree.

Definition at line 289 of file utils.py.

289 def do_sync(
290  web3: Any,
291  wallet: Wallet,
292  pp: PairingParameters,
293  wait_tx: Optional[str],
294  callback: Optional[Callable[[ZethNoteDescription], None]] = None,
295  batch_size: Optional[int] = None) -> int:
296  """
297  Implementation of sync, reused by several commands. Returns the
298  block_number synced to. Also updates and saves the MerkleTree.
299  """
300  def _do_sync() -> int:
301  wallet_next_block = wallet.get_next_block()
302  chain_block_number = get_block_number(web3)
303 
304  if chain_block_number >= wallet_next_block:
305  new_merkle_root: Optional[bytes] = None
306 
307  print(f"SYNCHING blocks ({wallet_next_block} - {chain_block_number})")
308  mixer_instance = wallet.mixer_instance
309  for mix_result in get_mix_results(
310  web3,
311  mixer_instance,
312  wallet_next_block,
313  chain_block_number,
314  batch_size):
315  new_merkle_root = mix_result.new_merkle_root
316  for note_desc in wallet.receive_notes(
317  mix_result.output_events, pp):
318  if callback:
319  callback(note_desc)
320 
321  spent_commits = wallet.mark_nullifiers_used(mix_result.nullifiers)
322  for commit in spent_commits:
323  print(f" SPENT: {commit}")
324 
325  wallet.update_and_save_state(next_block=chain_block_number + 1)
326 
327  # Check merkle root and save the updated tree
328  if new_merkle_root:
329  our_merkle_root = wallet.merkle_tree.get_root()
330  assert new_merkle_root == our_merkle_root
331 
332  return chain_block_number
333 
334  # Do a sync upfront (it would be a waste of time to wait for a tx before
335  # syncing, as it can take time to traverse all blocks). Then wait for a tx
336  # if requested, and sync again.
337 
338  if wait_tx:
339  _do_sync()
340  tx_receipt = web3.eth.waitForTransactionReceipt(wait_tx, 10000)
341  tx = web3.eth.getTransaction(wait_tx)
342  gas_used = tx_receipt.gasUsed
343  status = tx_receipt.status
344  size_bytes = len(tx.input)
345  print(
346  f"{wait_tx[0:8]}: gasUsed={gas_used}, status={status}, "
347  f"input_size={size_bytes}")
348 
349  return _do_sync()
350 
351 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_pub_address_file()

str zeth.cli.utils.find_pub_address_file ( str  base_file)
Given a file name, which could point to a private or public key file, guess
at the name of the public key file.

Definition at line 359 of file utils.py.

359 def find_pub_address_file(base_file: str) -> str:
360  """
361  Given a file name, which could point to a private or public key file, guess
362  at the name of the public key file.
363  """
364  pub_addr_file = pub_address_file(base_file)
365  if exists(pub_addr_file):
366  return pub_addr_file
367  if exists(base_file):
368  return base_file
369 
370  raise ClickException(f"No public key file {pub_addr_file} or {base_file}")
371 
372 
Here is the call graph for this function:

◆ get_erc20_abi()

Dict[str, Any] zeth.cli.utils.get_erc20_abi ( )

Definition at line 187 of file utils.py.

187 def get_erc20_abi() -> Dict[str, Any]:
188  zeth_dir = get_zeth_dir()
189  openzeppelin_dir = join(
190  zeth_dir, "zeth_contracts", "node_modules", "openzeppelin-solidity")
191  ierc20_path = join(
192  openzeppelin_dir, "contracts", "token", "ERC20", "IERC20.sol")
193  compiled_sol = compile_files([ierc20_path])
194  erc20_interface = compiled_sol[ierc20_path + ":IERC20"]
195  return erc20_interface["abi"]
196 
197 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_erc20_instance_description()

InstanceDescription zeth.cli.utils.get_erc20_instance_description ( str  token_address)

Definition at line 198 of file utils.py.

198 def get_erc20_instance_description(token_address: str) -> InstanceDescription:
199  return InstanceDescription(token_address, get_erc20_abi())
200 
201 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_eth_network()

NetworkConfig zeth.cli.utils.get_eth_network ( Optional[str]  eth_network)
Parse the `eth_network` parameter to extract a URL. If `eth_network` does
not contain a URL, try interpreting it as a network name, otherwise
interpret it as a file to load the network config from. Fall back to a
default network config filename, and finally the default network name.

Definition at line 84 of file utils.py.

84 def get_eth_network(eth_network: Optional[str]) -> NetworkConfig:
85  """
86  Parse the `eth_network` parameter to extract a URL. If `eth_network` does
87  not contain a URL, try interpreting it as a network name, otherwise
88  interpret it as a file to load the network config from. Fall back to a
89  default network config filename, and finally the default network name.
90  """
91  if eth_network is None:
92  if exists(ETH_NETWORK_FILE_DEFAULT):
93  eth_network = ETH_NETWORK_FILE_DEFAULT
94  else:
95  eth_network = ETH_NETWORK_DEFAULT
96 
97  if eth_network.startswith("http"):
98  # When given only a url, assume the default network name
99  return NetworkConfig(ETH_NETWORK_DEFAULT, eth_network)
100 
101  # Try loading from a file
102  if exists(eth_network):
103  with open(eth_network) as network_f:
104  return NetworkConfig.from_json(network_f.read())
105 
106  # Assume a network name
107  try:
108  endpoint = ETH_RPC_ENDPOINT_DEFAULTS[eth_network]
109  return NetworkConfig(eth_network, endpoint)
110  except KeyError as ex:
111  raise ClickException(f"invalid network name / url: {eth_network}") from ex
112 
113 
Here is the caller graph for this function:

◆ get_zeth_address_file()

str zeth.cli.utils.get_zeth_address_file ( ClientConfig  ctx)

Definition at line 224 of file utils.py.

224 def get_zeth_address_file(ctx: ClientConfig) -> str:
225  return ctx.address_file
226 
227 
Here is the caller graph for this function:

◆ load_contract_address()

str zeth.cli.utils.load_contract_address ( str  contract_addr)
Parse a string as either an eth address, or a contract instance file.

Definition at line 121 of file utils.py.

121 def load_contract_address(contract_addr: str) -> str:
122  """
123  Parse a string as either an eth address, or a contract instance file.
124  """
125  if contract_addr.startswith("0x"):
126  return Web3.toChecksumAddress(contract_addr)
127  if exists(contract_addr):
128  with open(contract_addr, "r") as instance_f:
129  instance = InstanceDescription.from_json_dict(json.load(instance_f))
130  return Web3.toChecksumAddress(instance.address)
131  raise ClickException(
132  f"failed to parse as address or instance file: {contract_addr}")
133 
134 
Here is the caller graph for this function:

◆ load_eth_address()

str zeth.cli.utils.load_eth_address ( Optional[str]  eth_addr)
Given an --eth-addr command line param, either parse the address, load from
the file, or use a default file name.

Definition at line 444 of file utils.py.

444 def load_eth_address(eth_addr: Optional[str]) -> str:
445  """
446  Given an --eth-addr command line param, either parse the address, load from
447  the file, or use a default file name.
448  """
449  eth_addr = eth_addr or ETH_ADDRESS_DEFAULT
450  if eth_addr.startswith("0x"):
451  return Web3.toChecksumAddress(eth_addr)
452  if exists(eth_addr):
453  with open(eth_addr, "r") as eth_addr_f:
454  return Web3.toChecksumAddress(eth_addr_f.read().rstrip())
455  raise ClickException(f"could find file or parse eth address: {eth_addr}")
456 
457 
Here is the caller graph for this function:

◆ load_eth_private_key()

Optional[bytes] zeth.cli.utils.load_eth_private_key ( Optional[str]  private_key_file)

Definition at line 465 of file utils.py.

465 def load_eth_private_key(private_key_file: Optional[str]) -> Optional[bytes]:
466  private_key_file = private_key_file or ETH_PRIVATE_KEY_FILE_DEFAULT
467  if exists(private_key_file):
468  with open(private_key_file, "rb") as private_key_f:
469  return private_key_f.read(32)
470  return None
471 
472 
Here is the caller graph for this function:

◆ load_mixer_description()

MixerDescription zeth.cli.utils.load_mixer_description ( str  mixer_desc_file)
Return mixer and token (if present) contract instances

Definition at line 212 of file utils.py.

212 def load_mixer_description(mixer_desc_file: str) -> MixerDescription:
213  """
214  Return mixer and token (if present) contract instances
215  """
216  with open(mixer_desc_file, "r") as desc_f:
217  return MixerDescription.from_json_dict(json.load(desc_f))
218 
219 
Here is the caller graph for this function:

◆ load_mixer_description_from_ctx()

MixerDescription zeth.cli.utils.load_mixer_description_from_ctx ( ClientConfig  ctx)

Definition at line 220 of file utils.py.

220 def load_mixer_description_from_ctx(ctx: ClientConfig) -> MixerDescription:
221  return load_mixer_description(ctx.instance_file)
222 
223 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_zeth_address()

ZethAddress zeth.cli.utils.load_zeth_address ( ClientConfig  ctx)
Load a ZethAddress secret from a file, and the associated public address,
and return as a ZethAddress.

Definition at line 265 of file utils.py.

265 def load_zeth_address(ctx: ClientConfig) -> ZethAddress:
266  """
267  Load a ZethAddress secret from a file, and the associated public address,
268  and return as a ZethAddress.
269  """
270  return ZethAddress.from_secret_public(
273 
274 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_zeth_address_public()

ZethAddressPub zeth.cli.utils.load_zeth_address_public ( ClientConfig  ctx)
Load a ZethAddressPub from a key file.

Definition at line 228 of file utils.py.

228 def load_zeth_address_public(ctx: ClientConfig) -> ZethAddressPub:
229  """
230  Load a ZethAddressPub from a key file.
231  """
232  secret_key_file = get_zeth_address_file(ctx)
233  pub_addr_file = pub_address_file(secret_key_file)
234  with open(pub_addr_file, "r") as pub_addr_f:
235  return ZethAddressPub.parse(pub_addr_f.read())
236 
237 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_zeth_address_secret()

ZethAddressPriv zeth.cli.utils.load_zeth_address_secret ( ClientConfig  ctx)
Read ZethAddressPriv

Definition at line 247 of file utils.py.

247 def load_zeth_address_secret(ctx: ClientConfig) -> ZethAddressPriv:
248  """
249  Read ZethAddressPriv
250  """
251  addr_file = get_zeth_address_file(ctx)
252  with open(addr_file, "r") as addr_f:
253  return ZethAddressPriv.from_json(addr_f.read())
254 
255 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_wallet()

Wallet zeth.cli.utils.open_wallet ( Any  mixer_instance,
ZethAddressPriv  js_secret,
ClientConfig  ctx 
)
Load a wallet using a secret key.

Definition at line 275 of file utils.py.

275 def open_wallet(
276  mixer_instance: Any,
277  js_secret: ZethAddressPriv,
278  ctx: ClientConfig) -> Wallet:
279  """
280  Load a wallet using a secret key.
281  """
282  wallet_dir = ctx.wallet_dir
283  prover_config = create_prover_client(ctx).get_configuration()
284  tree_hash = get_tree_hash_for_pairing(prover_config.pairing_parameters.name)
285  return Wallet(
286  mixer_instance, WALLET_USERNAME, wallet_dir, js_secret, tree_hash)
287 
288 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_web3_from_ctx()

Any zeth.cli.utils.open_web3_from_ctx ( ClientConfig  ctx)

Definition at line 135 of file utils.py.

135 def open_web3_from_ctx(ctx: ClientConfig) -> Any:
136  eth_net = get_eth_network(ctx.eth_network)
137  return open_web3_from_network(eth_net)
138 
139 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_web3_from_network()

Any zeth.cli.utils.open_web3_from_network ( NetworkConfig  eth_net)

Definition at line 114 of file utils.py.

114 def open_web3_from_network(eth_net: NetworkConfig) -> Any:
115  return open_web3(
116  url=eth_net.endpoint,
117  certificate=eth_net.certificate,
118  insecure=eth_net.insecure)
119 
120 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_output()

Tuple[ZethAddressPub, EtherValue] zeth.cli.utils.parse_output ( str  output_str)
Parse a string of the form "<receiver_pub_address>,<value>" to an output
specification. <receiver_pub_address> can be a file name containing the
address. "<value>" is interpreted as the <default-address-file>,<value>.

Definition at line 421 of file utils.py.

421 def parse_output(output_str: str) -> Tuple[ZethAddressPub, EtherValue]:
422  """
423  Parse a string of the form "<receiver_pub_address>,<value>" to an output
424  specification. <receiver_pub_address> can be a file name containing the
425  address. "<value>" is interpreted as the <default-address-file>,<value>.
426  """
427  parts = output_str.split(",")
428  if len(parts) == 1:
429  addr = ZETH_PUBLIC_ADDRESS_FILE_DEFAULT
430  value = parts[0]
431  elif len(parts) == 2:
432  addr = parts[0]
433  value = parts[1]
434  else:
435  raise ClickException(f"invalid output spec: {output_str}")
436 
437  if exists(addr):
438  with open(addr, "r") as addr_f:
439  addr = addr_f.read()
440 
441  return (ZethAddressPub.parse(addr), EtherValue(value))
442 
443 
Here is the caller graph for this function:

◆ pub_address_file()

str zeth.cli.utils.pub_address_file ( str  addr_file)
The name of a public address file, given the secret address file.

Definition at line 352 of file utils.py.

352 def pub_address_file(addr_file: str) -> str:
353  """
354  The name of a public address file, given the secret address file.
355  """
356  return splitext(addr_file)[0] + ".pub"
357 
358 
Here is the caller graph for this function:

◆ write_eth_address()

None zeth.cli.utils.write_eth_address ( str  eth_addr,
str  eth_addr_file 
)

Definition at line 458 of file utils.py.

458 def write_eth_address(eth_addr: str, eth_addr_file: str) -> None:
459  if exists(eth_addr_file):
460  raise ClickException(f"refusing to overwrite address \"{eth_addr_file}\"")
461  with open(eth_addr_file, "w") as eth_addr_f:
462  eth_addr_f.write(eth_addr)
463 
464 
Here is the caller graph for this function:

◆ write_eth_private_key()

None zeth.cli.utils.write_eth_private_key ( bytes  private_key,
str  private_key_file 
)

Definition at line 473 of file utils.py.

473 def write_eth_private_key(private_key: bytes, private_key_file: str) -> None:
474  if exists(private_key_file):
475  raise ClickException(
476  f"refusing to overwrite private key \"{private_key_file}\"")
477  with open(private_key_file, "wb") as private_key_f:
478  private_key_f.write(private_key)
Here is the caller graph for this function:

◆ write_mixer_description()

None zeth.cli.utils.write_mixer_description ( str  mixer_desc_file,
MixerDescription  mixer_desc 
)
Write the mixer (and token) instance information

Definition at line 202 of file utils.py.

203  mixer_desc_file: str,
204  mixer_desc: MixerDescription) -> None:
205  """
206  Write the mixer (and token) instance information
207  """
208  with open(mixer_desc_file, "w") as instance_f:
209  json.dump(mixer_desc.to_json_dict(), instance_f)
210 
211 
Here is the caller graph for this function:

◆ write_zeth_address_public()

None zeth.cli.utils.write_zeth_address_public ( ZethAddressPub  pub_addr,
str  pub_addr_file 
)
Write a ZethAddressPub to a file

Definition at line 238 of file utils.py.

239  pub_addr: ZethAddressPub, pub_addr_file: str) -> None:
240  """
241  Write a ZethAddressPub to a file
242  """
243  with open(pub_addr_file, "w") as pub_addr_f:
244  pub_addr_f.write(str(pub_addr))
245 
246 
Here is the caller graph for this function:

◆ write_zeth_address_secret()

None zeth.cli.utils.write_zeth_address_secret ( ZethAddressPriv  secret_addr,
str  addr_file 
)
Write ZethAddressPriv to file

Definition at line 256 of file utils.py.

257  secret_addr: ZethAddressPriv, addr_file: str) -> None:
258  """
259  Write ZethAddressPriv to file
260  """
261  with open(addr_file, "w") as addr_f:
262  addr_f.write(secret_addr.to_json())
263 
264 
Here is the caller graph for this function:

◆ zeth_note_short()

str zeth.cli.utils.zeth_note_short ( ZethNoteDescription  note_desc)
Generate a short human-readable description of a commitment.

Definition at line 408 of file utils.py.

408 def zeth_note_short(note_desc: ZethNoteDescription) -> str:
409  """
410  Generate a short human-readable description of a commitment.
411  """
412  value = from_zeth_units(int(note_desc.note.value, 16)).ether()
413  cm = short_commitment(note_desc.commitment)
414  return f"{cm}: value={value} ETH, addr={note_desc.address}"
415 
416 
Here is the call graph for this function:

◆ zeth_note_short_print()

None zeth.cli.utils.zeth_note_short_print ( ZethNoteDescription  note_desc)

Definition at line 417 of file utils.py.

417 def zeth_note_short_print(note_desc: ZethNoteDescription) -> None:
418  print(f" NEW NOTE: {zeth_note_short(note_desc)}")
419 
420 
zeth.cli.utils.get_eth_network
NetworkConfig get_eth_network(Optional[str] eth_network)
Definition: utils.py:84
test_commands.mock.str
str
Definition: mock.py:18
zeth.cli.utils.write_eth_address
None write_eth_address(str eth_addr, str eth_addr_file)
Definition: utils.py:458
zeth.cli.utils.open_web3_from_ctx
Any open_web3_from_ctx(ClientConfig ctx)
Definition: utils.py:135
zeth.cli.utils.create_prover_client
ProverClient create_prover_client(ClientConfig ctx)
Definition: utils.py:373
zeth.cli.utils.write_zeth_address_public
None write_zeth_address_public(ZethAddressPub pub_addr, str pub_addr_file)
Definition: utils.py:238
zeth.cli.utils.load_contract_address
str load_contract_address(str contract_addr)
Definition: utils.py:121
zeth.cli.utils.open_wallet
Wallet open_wallet(Any mixer_instance, ZethAddressPriv js_secret, ClientConfig ctx)
Definition: utils.py:275
zeth.cli.zeth_deploy.int
int
Definition: zeth_deploy.py:27
zeth.core.utils.open_web3
Any open_web3(str url, Optional[str] certificate=None, bool insecure=False)
Definition: utils.py:28
zeth.cli.utils.load_eth_address
str load_eth_address(Optional[str] eth_addr)
Definition: utils.py:444
zeth.cli.utils.find_pub_address_file
str find_pub_address_file(str base_file)
Definition: utils.py:359
zeth.cli.utils.load_mixer_description_from_ctx
MixerDescription load_mixer_description_from_ctx(ClientConfig ctx)
Definition: utils.py:220
zeth.cli.utils.create_mixer_client_and_mixer_desc
Tuple[MixerClient, MixerDescription] create_mixer_client_and_mixer_desc(ClientConfig ctx, Optional[ProverClient] prover_client=None)
Definition: utils.py:391
zeth.core.utils.get_zeth_dir
str get_zeth_dir()
Definition: utils.py:249
zeth.cli.utils.load_zeth_address_secret
ZethAddressPriv load_zeth_address_secret(ClientConfig ctx)
Definition: utils.py:247
zeth.cli.utils.parse_output
Tuple[ZethAddressPub, EtherValue] parse_output(str output_str)
Definition: utils.py:421
zeth.core.mimc.get_tree_hash_for_pairing
ITreeHash get_tree_hash_for_pairing(str pairing_name)
Definition: mimc.py:138
zeth.cli.utils.load_zeth_address
ZethAddress load_zeth_address(ClientConfig ctx)
Definition: utils.py:265
zeth.cli.utils.zeth_note_short_print
None zeth_note_short_print(ZethNoteDescription note_desc)
Definition: utils.py:417
zeth.cli.utils.zeth_note_short
str zeth_note_short(ZethNoteDescription note_desc)
Definition: utils.py:408
zeth.core.contracts.compile_files
Any compile_files(List[str] files, **Any kwargs)
Definition: contracts.py:122
zeth.cli.utils.get_zeth_address_file
str get_zeth_address_file(ClientConfig ctx)
Definition: utils.py:224
zeth.cli.utils.write_eth_private_key
None write_eth_private_key(bytes private_key, str private_key_file)
Definition: utils.py:473
zeth.cli.utils.load_eth_private_key
Optional[bytes] load_eth_private_key(Optional[str] private_key_file)
Definition: utils.py:465
zeth.cli.utils.write_mixer_description
None write_mixer_description(str mixer_desc_file, MixerDescription mixer_desc)
Definition: utils.py:202
zeth.core.utils.short_commitment
str short_commitment(bytes cm)
Definition: utils.py:306
zeth.cli.utils.load_mixer_description
MixerDescription load_mixer_description(str mixer_desc_file)
Definition: utils.py:212
zeth.cli.utils.open_web3_from_network
Any open_web3_from_network(NetworkConfig eth_net)
Definition: utils.py:114
zeth.core.utils.from_zeth_units
EtherValue from_zeth_units(int zeth_units)
Definition: utils.py:227
zeth.core.contracts.get_block_number
int get_block_number(Any web3)
Definition: contracts.py:114
zeth.cli.utils.write_zeth_address_secret
None write_zeth_address_secret(ZethAddressPriv secret_addr, str addr_file)
Definition: utils.py:256
zeth.cli.utils.pub_address_file
str pub_address_file(str addr_file)
Definition: utils.py:352
zeth.cli.utils.load_zeth_address_public
ZethAddressPub load_zeth_address_public(ClientConfig ctx)
Definition: utils.py:228
zeth.cli.utils.do_sync
int do_sync(Any web3, Wallet wallet, PairingParameters pp, Optional[str] wait_tx, Optional[Callable[[ZethNoteDescription], None]] callback=None, Optional[int] batch_size=None)
Definition: utils.py:289
zeth.cli.utils.get_erc20_instance_description
InstanceDescription get_erc20_instance_description(str token_address)
Definition: utils.py:198
zeth.core.mixer_client.get_mix_results
Iterator[MixResult] get_mix_results(Any web3, Any mixer_instance, int start_block, int end_block, Optional[int] batch_size=None)
Definition: mixer_client.py:640
zeth.cli.utils.create_mixer_client
MixerClient create_mixer_client(ClientConfig ctx, Optional[ProverClient] prover_client=None)
Definition: utils.py:381
zeth.cli.utils.get_erc20_abi
Dict[str, Any] get_erc20_abi()
Definition: utils.py:187