Update url
This commit is contained in:
parent
11568ee2ba
commit
18a4d65784
55
chainqueue/db/migrations/sqlalchemy.py
Normal file
55
chainqueue/db/migrations/sqlalchemy.py
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
def chainqueue_upgrade(major, minor, patch):
|
||||||
|
r0_0_1_u()
|
||||||
|
|
||||||
|
|
||||||
|
def chainqueue_downgrade(major, minor, patch):
|
||||||
|
r0_0_1_d()
|
||||||
|
|
||||||
|
|
||||||
|
def r0_0_1_u():
|
||||||
|
op.create_table(
|
||||||
|
'otx',
|
||||||
|
sa.Column('id', sa.Integer, primary_key=True),
|
||||||
|
sa.Column('date_created', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('date_updated', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('nonce', sa.Integer, nullable=False),
|
||||||
|
sa.Column('tx_hash', sa.Text, nullable=False),
|
||||||
|
sa.Column('signed_tx', sa.Text, nullable=False),
|
||||||
|
sa.Column('status', sa.Integer, nullable=False, default=0),
|
||||||
|
sa.Column('block', sa.Integer),
|
||||||
|
)
|
||||||
|
op.create_index('idx_otx_tx', 'otx', ['tx_hash'], unique=True)
|
||||||
|
|
||||||
|
op.create_table(
|
||||||
|
'otx_state_log',
|
||||||
|
sa.Column('id', sa.Integer, primary_key=True),
|
||||||
|
sa.Column('otx_id', sa.Integer, sa.ForeignKey('otx.id'), nullable=False),
|
||||||
|
sa.Column('date', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('status', sa.Integer, nullable=False),
|
||||||
|
)
|
||||||
|
|
||||||
|
op.create_table(
|
||||||
|
'tx_cache',
|
||||||
|
sa.Column('id', sa.Integer, primary_key=True),
|
||||||
|
sa.Column('otx_id', sa.Integer, sa.ForeignKey('otx.id'), nullable=True),
|
||||||
|
sa.Column('date_created', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('date_updated', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('date_checked', sa.DateTime, nullable=False),
|
||||||
|
sa.Column('source_token_address', sa.String(42), nullable=False),
|
||||||
|
sa.Column('destination_token_address', sa.String(42), nullable=False),
|
||||||
|
sa.Column('sender', sa.String(42), nullable=False),
|
||||||
|
sa.Column('recipient', sa.String(42), nullable=False),
|
||||||
|
sa.Column('from_value', sa.NUMERIC(), nullable=False),
|
||||||
|
sa.Column('to_value', sa.NUMERIC(), nullable=True),
|
||||||
|
sa.Column('tx_index', sa.Integer, nullable=True),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def r0_0_1_d():
|
||||||
|
op.drop_table('tx_cache')
|
||||||
|
op.drop_table('otx_state_log')
|
||||||
|
op.drop_index('idx_otx_tx')
|
||||||
|
op.drop_table('otx')
|
@ -460,11 +460,11 @@ class Otx(SessionBase):
|
|||||||
|
|
||||||
if confirmed:
|
if confirmed:
|
||||||
status = self.status
|
status = self.status
|
||||||
if self.status > 0 and self.status & (StatusBits.OBSOLETE & StatusBits.IN_NETWORK) == 0:
|
if self.status > 0 and self.status & (StatusBits.OBSOLETE | StatusBits.IN_NETWORK) == 0:
|
||||||
SessionBase.release_session(session)
|
SessionBase.release_session(session)
|
||||||
raise TxStateChangeError('CANCEL can only be set on an entry marked OBSOLETE ({})'.format(status))
|
raise TxStateChangeError('CANCEL can only be set on an entry marked OBSOLETE or IN_NETWORK ({})'.format(status))
|
||||||
self.__set_status(StatusEnum.FINAL, session)
|
self.__set_status(StatusBits.FINAL, session)
|
||||||
self.__set_status(StatusEnum.OBSOLETED, session)
|
self.__set_status(StatusBits.OBSOLETE, session)
|
||||||
|
|
||||||
self.__reset_status(StatusBits.RESERVED | StatusBits.QUEUED, session)
|
self.__reset_status(StatusBits.RESERVED | StatusBits.QUEUED, session)
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = chainqueue
|
name = chainqueue
|
||||||
version = 0.0.2a1
|
version = 0.0.2a2
|
||||||
description = Generic blockchain transaction queue control
|
description = Generic blockchain transaction queue control
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
url = https://gitlab.com/nolash/chainlib
|
url = https://gitlab.com/chaintools/chainqueue
|
||||||
keywords =
|
keywords =
|
||||||
cic
|
cic
|
||||||
cryptocurrency
|
cryptocurrency
|
||||||
|
Loading…
Reference in New Issue
Block a user