Skip to content

Commit

Permalink
Removed cosmpy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
MissingNO57 committed Jun 11, 2024
1 parent 6ace1bd commit 5ee67ce
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 542 deletions.
29 changes: 27 additions & 2 deletions scripts/genesis_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,35 @@
import os
import re
import subprocess

import bech32
import sys
from cosmpy.crypto.hashfuncs import sha256, ripemd160
from Crypto.Hash import RIPEMD160 # type: ignore # nosec


def sha256(contents: bytes) -> bytes:
"""
Get sha256 hash.
:param contents: bytes contents.
:return: bytes sha256 hash.
"""
h = hashlib.sha256()
h.update(contents)
return h.digest()


def ripemd160(contents: bytes) -> bytes:
"""
Get ripemd160 hash using PyCryptodome.
:param contents: bytes contents.
:return: bytes ripemd160 hash.
"""
h = RIPEMD160.new()
h.update(contents)
return h.digest()


def get_path(text: str) -> str:
Expand Down
Loading

0 comments on commit 5ee67ce

Please sign in to comment.