initialize version/lock_time in TransactionType

pull/1/head
Pavol Rusnak 10 years ago
parent 51b9d4e177
commit dc0d7fd1d6

@ -27,8 +27,8 @@ if len(devices) > 0:
else:
print 'Using Emulator'
TRANSPORT = PipeTransport
TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor', False)
TRANSPORT_ARGS = ('/tmp/pipe.trezor', False)
TRANSPORT_KWARGS = {}
DEBUG_TRANSPORT = PipeTransport
DEBUG_TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor_debug', False)
DEBUG_TRANSPORT_ARGS = ('/tmp/pipe.trezor_debug', False)
DEBUG_TRANSPORT_KWARGS = {}

@ -14,7 +14,7 @@ class FakeTestnetBlockchain(object):
if txhash != '6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54':
raise Exception("Unexpected hash")
t = proto_types.TransactionType(version = 1, lock_time = 0)
t = proto_types.TransactionType()
i = t.inputs.add()
i.prev_hash = binascii.unhexlify('ee336e79153d51f4f3e45278f1f77ab29fd5bb135dce467282e2aff22cb9c570')
@ -34,6 +34,8 @@ class FakeTestnetBlockchain(object):
o.amount = 1000000000
o.script_pubkey = binascii.unhexlify('76a91424a56db43cf6f2b02e838ea493f95d8d6047423188ac')
t.version = 1
t.lock_time = 0
return t
class TestMsgSimplesigntx(common.TrezorTest):

@ -30,7 +30,7 @@ class BlockchainApi(object):
def get_tx(self, txhash):
# Build protobuf transaction structure from blockchain.info
d = self._raw_tx(txhash)
t = proto_types.TransactionType(version = 1, lock_time = 0)
t = proto_types.TransactionType()
for inp in d['inputs']:
di = self._raw_tx(inp['prev_out']['tx_index'])
@ -44,6 +44,8 @@ class BlockchainApi(object):
o.amount = output['value']
o.script_pubkey = binascii.unhexlify(output['script'])
t.version = 1
t.lock_time = 0
return t
if __name__ == '__main__':

Loading…
Cancel
Save