MCPcopy Create free account
hub / github.com/ElementsProject/elements / CTxWitness

Class CTxWitness

test/functional/test_framework/messages.py:762–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760
761
762class CTxWitness:
763 __slots__ = ("vtxinwit", "vtxoutwit")
764
765 def __init__(self):
766 self.vtxinwit = []
767 self.vtxoutwit = []
768
769 def deserialize(self, f):
770 for i in range(len(self.vtxinwit)):
771 self.vtxinwit[i].deserialize(f)
772 for i in range(len(self.vtxoutwit)):
773 self.vtxoutwit[i].deserialize(f)
774
775 def serialize(self):
776 r = b""
777 # This is different than the usual vector serialization --
778 # we omit the length of the vector, which is required to be
779 # the same length as the transaction's vin vector.
780 for x in self.vtxinwit:
781 r += x.serialize()
782 for x in self.vtxoutwit:
783 r += x.serialize()
784 return r
785
786 def __repr__(self):
787 return "CTxWitness([%s], [%s])" % \
788 (';'.join([repr(x) for x in self.vtxinwit]),
789 ';'.join([repr(x) for x in self.vtxoutwit]))
790
791 def is_null(self):
792 for x in self.vtxinwit:
793 if not x.is_null():
794 return False
795 for x in self.vtxoutwit:
796 if not x.is_null():
797 return False
798 return True
799
800
801class CTransaction:

Callers 3

test_submit_blockMethod · 0.90
__init__Method · 0.70
deserializeMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_submit_blockMethod · 0.72