-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultisigtables.py
More file actions
72 lines (59 loc) · 2.12 KB
/
multisigtables.py
File metadata and controls
72 lines (59 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import sqlalchemy as sql
from sqlalchemy import Column, String,Float, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class multisig(Base):
__tablename__ = "multisig"
address1 = Column(String)
address2 = Column(String)
address3 = Column(String)
privkey1 = Column(String)
privkey2 = Column(String)
privkey3 = Column(String)
multiaddress = Column(String, primary_key=True)
redeemscript = Column(String)
status = Column(String)
class user_info(Base):
__tablename__ = "user_info"
user = Column(String, primary_key = True)
address = Column(String)
registered = Column(Boolean)
banned = Column(Boolean)
txs = Column(String)
auto_accept_arb = Column(Boolean)
def __repr__(self):
return "<user_info for %s>" % (self.user)
class escrow_address(Base):
__tablename__ = "escrow"
multi_address = Column(String,primary_key = True)
seller = Column(String)
buyer = Column(String)
arbitrator = Column(String)
seller_registered = Column(Boolean)
buyer_registered = Column(Boolean)
arbitrator_accept = Column(Boolean)
seller_vote = Column(String)
buyer_vote = Column(String)
arbitrator_vote = Column(String)
seller_private_key = Column(String)
buyer_private_key = Column(String)
arbitrator_private_key=Column(String)
date_created = Column(String)
redeem_script = Column(String)
tx_id = Column(String)
complete = Column(Boolean)
status = Column(String) #"new" , "waiting on register" "waiting on funds" , "funded" , "complete","failed","timeout"
def __repr__(self):
return "add: %s status: %s" % (self.multi_address, self.status)
if __name__ == "__main__":
engine = sql.create_engine("sqlite:///multisig.db")
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
session = Session()
session.commit()
session.add(multisig(multiaddress="*"))
session.add(user_info(user = "*"))
session.add(escrow_address(multi_address = "*"))
session.commit()
session.close()