renamed PossiblyNone to PossiblyNoneType
authorForrest Voight <forrest@forre.st>
Sun, 14 Aug 2011 09:38:20 +0000 (05:38 -0400)
committerForrest Voight <forrest@forre.st>
Sun, 14 Aug 2011 09:38:20 +0000 (05:38 -0400)
p2pool/bitcoin/data.py
p2pool/bitcoin/p2p.py
p2pool/data.py
p2pool/p2p.py

index b103cda..1edae88 100644 (file)
@@ -379,7 +379,7 @@ class FloatingIntegerType(Type):
     def write(self, file, item):
         return self._inner.write(file, item._bits)
 
-class PossiblyNone(Type):
+class PossiblyNoneType(Type):
     def __init__(self, none_value, inner):
         self.none_value = none_value
         self.inner = inner
@@ -402,12 +402,12 @@ address_type = ComposedType([
 tx_type = ComposedType([
     ('version', StructType('<I')),
     ('tx_ins', ListType(ComposedType([
-        ('previous_output', PossiblyNone(dict(hash=0, index=2**32 - 1), ComposedType([
+        ('previous_output', PossiblyNoneType(dict(hash=0, index=2**32 - 1), ComposedType([
             ('hash', HashType()),
             ('index', StructType('<I')),
         ]))),
         ('script', VarStrType()),
-        ('sequence', PossiblyNone(2**32 - 1, StructType('<I'))),
+        ('sequence', PossiblyNoneType(2**32 - 1, StructType('<I'))),
     ]))),
     ('tx_outs', ListType(ComposedType([
         ('value', StructType('<Q')),
@@ -418,7 +418,7 @@ tx_type = ComposedType([
 
 block_header_type = ComposedType([
     ('version', StructType('<I')),
-    ('previous_block', PossiblyNone(0, HashType())),
+    ('previous_block', PossiblyNoneType(0, HashType())),
     ('merkle_root', HashType()),
     ('timestamp', StructType('<I')),
     ('target', FloatingIntegerType()),
index d500417..d4716da 100644 (file)
@@ -212,12 +212,12 @@ class Protocol(BaseProtocol):
     message_getblocks = bitcoin_data.ComposedType([
         ('version', bitcoin_data.StructType('<I')),
         ('have', bitcoin_data.ListType(bitcoin_data.HashType())),
-        ('last', bitcoin_data.PossiblyNone(0, bitcoin_data.HashType())),
+        ('last', bitcoin_data.PossiblyNoneType(0, bitcoin_data.HashType())),
     ])
     message_getheaders = bitcoin_data.ComposedType([
         ('version', bitcoin_data.StructType('<I')),
         ('have', bitcoin_data.ListType(bitcoin_data.HashType())),
-        ('last', bitcoin_data.PossiblyNone(0, bitcoin_data.HashType())),
+        ('last', bitcoin_data.PossiblyNoneType(0, bitcoin_data.HashType())),
     ])
     message_getaddr = bitcoin_data.ComposedType([])
     message_checkorder = bitcoin_data.ComposedType([
@@ -265,7 +265,7 @@ class Protocol(BaseProtocol):
     message_reply = bitcoin_data.ComposedType([
         ('hash', bitcoin_data.HashType()),
         ('reply',  bitcoin_data.EnumType(bitcoin_data.StructType('<I'), {'success': 0, 'failure': 1, 'denied': 2})),
-        ('script', bitcoin_data.PossiblyNone('', bitcoin_data.VarStrType())),
+        ('script', bitcoin_data.PossiblyNoneType('', bitcoin_data.VarStrType())),
     ])
     def handle_reply(self, hash, reply, script):
         self.check_order.got_response(hash, dict(reply=reply, script=script))
index 5e4c149..e28bf5c 100644 (file)
@@ -19,7 +19,7 @@ merkle_branch_type = bitcoin_data.ListType(bitcoin_data.ComposedType([
 
 
 share_data_type = bitcoin_data.ComposedType([
-    ('previous_share_hash', bitcoin_data.PossiblyNone(0, bitcoin_data.HashType())),
+    ('previous_share_hash', bitcoin_data.PossiblyNoneType(0, bitcoin_data.HashType())),
     ('target', bitcoin_data.FloatingIntegerType()),
     ('nonce', bitcoin_data.VarStrType()),
 ])
index a6605a5..924277f 100644 (file)
@@ -92,7 +92,7 @@ class Protocol(bitcoin_p2p.BaseProtocol):
         ('nonce', bitcoin_data.StructType('<Q')),
         ('sub_version', bitcoin_data.VarStrType()),
         ('mode', bitcoin_data.StructType('<I')),
-        ('best_share_hash', bitcoin_data.PossiblyNone(0, bitcoin_data.HashType())),
+        ('best_share_hash', bitcoin_data.PossiblyNoneType(0, bitcoin_data.HashType())),
     ])
     def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
         self.other_version = version