Example #1
0
	def deserialize(data):
		"""
		De-serializes a MultiSigTransaction.
		This is a static method: it can be called without having an instance,
		as an alternative to calling the constructor directly.

		Arguments:
		data: str; the serialized MultiSigTransaction.

		Return value:
		MultiSigTransaction; the created transaction structure.

		Exceptions:
		Exception: deserialization failed
		"""

		length = struct.unpack('!I', data[:4])[0] #uint32_t
		TCDlist = tcd.deserializeList(data[4:4+length])
		transaction = bitcointransaction.Transaction.deserialize(data[4+length:])
		return MultiSigTransaction(transaction, TCDlist)
Example #2
0
	def makeFromState(state):
		"""
		Make a MultiSigTransaction, based on the given state object.
		This is a static method: it can be called without having an instance,
		as an alternative to calling the constructor directly.

		Arguments:
		state: A data structure, consisting of only standard Python types like
		       dict, list, str, bool, int.

		Return value:
		MultiSigTransaction; the created transaction structure.

		Exceptions:
		Exception: loading from the state object failed
		"""

		transaction = bitcointransaction.Transaction.deserialize(
			binascii.unhexlify(state["tx"])
			)
		TCDlist = tcd.deserializeList(
			binascii.unhexlify(state["TCDs"])
			)
		return MultiSigTransaction(transaction, TCDlist)