def issue(self, symbol, quantity):
    logging.info('going to issue with symbol:{}'.format(symbol))
    ver = super.ver
    super.ver += 1
    m = hashlib.sha256()
    m.update(bytes(symbol, 'utf-8'))
    sha256_id = m.hexdigest()
    result = super.session.execute('select block_counter from symbol_chain where sha256_id = {0}'.format(sha256_id)).one()
    if (not result):
        counter = 0
    else:
        counter = int(result.block_counter)
    counter += 1
    super.session.execute(self.updateSymbolChain, [symbol, ver, counter, sha256_id])
    block_id = super.session.execute('select sha256_id from blocks_view where counter = {}'.format(counter)).one()
    note_id = '{}||{}||{}'.format(symbol, block_id[:16], quantity)
    super.session.execute(self.newDraft, [m.hexdigest(), note_id[:32], sha256_id, ver, quantity, block_id, 'issue'])
def issue(self, symbol, quantity):
    logging.info('going to issue with symbol:{}'.format(symbol))
    ver = super.ver
    super.ver += 1
    m = hashlib.sha256()
    m.update(bytes(symbol, 'utf-8'))
    sha256_id = m.hexdigest()
    result = super.session.execute('select block_counter from symbol_chain where sha256_id = {0}'.format(sha256_id)).one()
    if (not result):
        counter = 0
    else:
        counter = int(result.block_counter)
    counter += 1
    super.session.execute(self.updateSymbolChain, [symbol, ver, counter, sha256_id])
    block_id = super.session.execute('select sha256_id from blocks_view where counter = {}'.format(counter)).one()
    note_id = '{}||{}||{}'.format(symbol, block_id[:16], quantity)
    super.session.execute(self.newDraft, [m.hexdigest(), note_id[:32], sha256_id, ver, quantity, block_id, 'issue'])