Created
December 11, 2014 04:31
-
-
Save theblacksquid/3cd222f6da08a574cfad to your computer and use it in GitHub Desktop.
contractlib [BUGGED]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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