remove run_program, move hash to util

This commit is contained in:
Yostra 2020-02-07 11:55:01 -08:00
parent e49e1a1f6c
commit 84a51ee87a
5 changed files with 13 additions and 6 deletions

10
src/util/Hash.py Normal file
View File

@ -0,0 +1,10 @@
import blspy
from src.types.sized_bytes import bytes32
def std_hash(b) -> bytes32:
"""
The standard hash used in many places.
"""
return bytes32(blspy.Util.hash256(bytes(b)))

View File

@ -17,7 +17,7 @@ from src.util.consensus import conditions_dict_for_solution
import time
from src.util.ints import uint64
from src.util.run_program import run_program
from clvm import run_program
def mempool_assert_coin_consumed(

View File

@ -1,3 +0,0 @@
import clvm
run_program = clvm.run_program

View File

@ -20,7 +20,7 @@ from src.types.hashable.Program import Program
# contract:
# generate puzzle: (() . puzzle_parameters)
# generate solution: (1 . (puzzle_parameters . solution_parameters))
from src.util.run_program import run_program
from clvm import run_program
def make_contract():

View File

@ -18,7 +18,7 @@ import hashlib
from clvm_tools import binutils
from src.types.hashable.Program import Program
from src.util.run_program import run_program
from clvm import run_program
from .load_clvm import load_clvm