예제 #1
0
def sign(tx_json, secret, test=False):
	""" Signs a transaction with the secret and returns a tx_blob """

	seed = address.seed_from_human(secret)
	pubkey = crypto.get_public_key(seed)
	tx_json['SigningPubKey'] = pubkey

	tx_blob = serialize.serialize_json(tx_json)
	signature = _sign_blob(tx_blob, seed, test)
	tx_json['TxnSignature'] = signature

	tx_blob = serialize.serialize_json(tx_json)
	return utils.to_hex(tx_blob)
예제 #2
0
	def test_to_hex(self):
		s = '\01\x0f'
		self.assertEqual('010F', utils.to_hex(s))
예제 #3
0
 def test_to_hex(self):
     s = '\01\x0f'
     self.assertEqual('010F', utils.to_hex(s))