aergo.herapy.utils package¶
Submodules¶
aergo.herapy.utils.converter module¶
Common utility module for converting types.
-
aergo.herapy.utils.converter.
convert_aergo_conf_to_toml
(aergo_conf: aergo.herapy.obj.aergo_conf.AergoConfig) → str[source]¶
-
aergo.herapy.utils.converter.
convert_bytes_to_public_key
(v: bytes, curve: ecdsa.curves.Curve = SECP256k1) → ecdsa.ecdsa.Public_key[source]¶
-
aergo.herapy.utils.converter.
convert_public_key_to_bytes
(pubkey, curve=SECP256k1, compressed=True) → bytes[source]¶
-
aergo.herapy.utils.converter.
convert_toml_to_aergo_conf
(v: str) → aergo.herapy.obj.aergo_conf.AergoConfig[source]¶
-
aergo.herapy.utils.converter.
get_hash
(*strings, no_rand: bool = False, no_encode: bool = False) → Union[str, bytes, None][source]¶
aergo.herapy.utils.encoding module¶
-
aergo.herapy.utils.encoding.
decode_private_key
(private_key: Optional[str]) → Optional[bytes][source]¶
-
aergo.herapy.utils.encoding.
decode_tx_hash
(tx_hash: Union[str, bytes, None]) → Optional[bytes][source]¶
aergo.herapy.utils.merkle_proof module¶
-
aergo.herapy.utils.merkle_proof.
verify_exclusion
(root: bytes, ap: List[bytes], key: bytes, proofKey: bytes, proofVal: bytes) → bool[source]¶ verify_exclusion verifies the merkle proof that a default node (bytes([0]) is included on the path of the ‘key’, or that the proofKey/proofVal key pair is included on the path of the ‘key’
-
aergo.herapy.utils.merkle_proof.
verify_exclusion_c
(root: bytes, ap: List[bytes], length: int, bitmap: bytes, key: bytes, proofKey: bytes, proofVal: bytes) → bool[source]¶ verify_exclusion_c verifies the compressed merkle proof that a default node (bytes([0]) is included on the path of the ‘key’, or that the proofKey/proofVal key pair is included on the path of the ‘key’
-
aergo.herapy.utils.merkle_proof.
verify_inclusion
(ap: List[bytes], root: bytes, key: bytes, value: bytes) → bool[source]¶ verify_inclusion verifies the merkle proof ‘ap’ (audit path) that the key/value pair in included in the trie with root ‘root’.
-
aergo.herapy.utils.merkle_proof.
verify_inclusion_c
(ap: List[bytes], height: int, bitmap: bytes, root: bytes, key: bytes, value: bytes) → bool[source]¶ verify_inclusion verifies the compressed merkle proof ‘ap’ (audit path) that the key/value pair in included in the trie with root ‘root’.
aergo.herapy.utils.signature module¶
-
aergo.herapy.utils.signature.
uncompress_key
(compressed_key_hex)[source]¶ base source : https://stackoverflow.com/questions/43629265/deriving-an- ecdsa-uncompressed-public-key-from-a-compressed-one?rq=1 The code from bitcointalk sometimes produces a hex string uncompressed key of uneven length.