Ejemplo n.º 1
0
 def generate_avm_code(contract_path: str):
     compiler = Compiler.load(contract_path)
     raw_avm = compiler.write()
     hex_avm = OBoxCompiler.__to_hex_avm(raw_avm)
     return hex_avm
Ejemplo n.º 2
0
def create_avm_file(path_to_py_file):
    comp = Compiler.load(path_to_py_file)
    data = comp.write()
    return data.hex()
Ejemplo n.º 3
0
 def test_abi_methods_without_entry_point(self):
     path = '%s/boa_test/example/AbiMethods3.py' % TestContract.dirname
     output = Compiler.load(path).default
     self.assertEqual(len(output.abi_methods), 1)
     self.assertEqual(output.abi_entry_point, None)
     self.assertRaises(Exception, output.write)
Ejemplo n.º 4
0
def compile(path_to_py_file):
    comp = Compiler.load(path_to_py_file)
    script = binascii.hexlify(comp.write())
    scriptHash = ToScriptHash(script, True).ToString()
    return {"avm": script.decode("utf-8"), "scriptHash": scriptHash}