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.core.wallet.WalletState Class Reference

Public Member Functions

def __init__ (self, int next_block, int num_notes, NullifierMap nullifier_map)
 
str to_json (self)
 

Static Public Member Functions

WalletState from_json (str json_str)
 

Public Attributes

 next_block
 
 num_notes
 
 nullifier_map
 

Detailed Description

State to be saved in the wallet (excluding individual notes). As well as
the next block to query, we store some information about the state of the
Zeth deployment such as the number of notes or the number of distinct
addresses seen. This can be useful to estimate the security of a given
transaction.

Definition at line 68 of file wallet.py.

Constructor & Destructor Documentation

◆ __init__()

def zeth.core.wallet.WalletState.__init__ (   self,
int  next_block,
int  num_notes,
NullifierMap  nullifier_map 
)

Definition at line 76 of file wallet.py.

76  def __init__(
77  self, next_block: int, num_notes: int, nullifier_map: NullifierMap):
78  self.next_block = next_block
79  self.num_notes = num_notes
80  self.nullifier_map = nullifier_map
81 

Member Function Documentation

◆ from_json()

WalletState zeth.core.wallet.WalletState.from_json ( str  json_str)
static

Definition at line 91 of file wallet.py.

91  def from_json(json_str: str) -> WalletState:
92  json_dict = json.loads(json_str)
93  return WalletState(
94  next_block=int(json_dict["next_block"]),
95  num_notes=int(json_dict["num_notes"]),
96  nullifier_map=cast(NullifierMap, json_dict["nullifier_map"]))
97 
98 

◆ to_json()

str zeth.core.wallet.WalletState.to_json (   self)

Definition at line 82 of file wallet.py.

82  def to_json(self) -> str:
83  json_dict = {
84  "next_block": self.next_block,
85  "num_notes": self.num_notes,
86  "nullifier_map": self.nullifier_map,
87  }
88  return json.dumps(json_dict, indent=4)
89 

Member Data Documentation

◆ next_block

zeth.core.wallet.WalletState.next_block

Definition at line 77 of file wallet.py.

◆ nullifier_map

zeth.core.wallet.WalletState.nullifier_map

Definition at line 79 of file wallet.py.

◆ num_notes

zeth.core.wallet.WalletState.num_notes

Definition at line 78 of file wallet.py.


The documentation for this class was generated from the following file:
zeth.cli.zeth_deploy.int
int
Definition: zeth_deploy.py:27