cic-cli/cic/proof.py
2021-10-09 19:56:29 +02:00

46 lines
979 B
Python

# standard imports
import os
import json
# local imports
from .base import *
class Proof(Data):
def __init__(self, path='.'):
super(Proof, self).__init__()
self.namespace = 'ge'
self.description = None
self.path = path
self.proof_path = os.path.join(self.path, 'proof.json')
def load(self):
super(Meta, self).load()
f = open(self.proof_path, 'w')
o = json.read(f)
f.close()
self.description = o['description']
self.version = o['version']
self.namespace = o['namespace']
self.inited = True
def start(self):
super(Proof, self).start()
proof_template_file_path = os.path.join(data_dir, 'proof_template_v{}.json'.format(self.version()))
f = open(proof_template_file_path)
o = json.load(f)
f.close()
f = open(self.proof_path, 'w')
json.dump(o, f)
f.close()