Skip to content

Instantly share code, notes, and snippets.

@theblacksquid
Created December 11, 2014 04:31
Show Gist options
  • Save theblacksquid/3cd222f6da08a574cfad to your computer and use it in GitHub Desktop.
Save theblacksquid/3cd222f6da08a574cfad to your computer and use it in GitHub Desktop.
contractlib [BUGGED]
class ContractPart:
def __init__(self, nym, item, price,
sig, contract_exp=None):
self.nym = nym
self.item = item
self.price = str(price)+"BTC"
self.contract_exp = contract_exp
self.sig = sig
def json_conv(self):
result = ""
#convert above info into JSON,
return result
def xml_conv(self):
result = ""
#convert above info into xml,
return result
class BuyerPart(ContractPart): #here's one way I tried doing it.
self.party = "buyer"
def getParty(self):
return self.party
class SellerPart(ContractPart): #here's one other solution i tried
def __init__(self):
self.party = "seller"
def getParty(self)
return self.party
john_doe = BuyerPart("John Doe", "teddy bear", "0.005")
john_doe.getParty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment