initialize version/lock_time in TransactionType
This commit is contained in:
parent
51b9d4e177
commit
dc0d7fd1d6
|
@ -27,8 +27,8 @@ if len(devices) > 0:
|
||||||
else:
|
else:
|
||||||
print 'Using Emulator'
|
print 'Using Emulator'
|
||||||
TRANSPORT = PipeTransport
|
TRANSPORT = PipeTransport
|
||||||
TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor', False)
|
TRANSPORT_ARGS = ('/tmp/pipe.trezor', False)
|
||||||
TRANSPORT_KWARGS = {}
|
TRANSPORT_KWARGS = {}
|
||||||
DEBUG_TRANSPORT = PipeTransport
|
DEBUG_TRANSPORT = PipeTransport
|
||||||
DEBUG_TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor_debug', False)
|
DEBUG_TRANSPORT_ARGS = ('/tmp/pipe.trezor_debug', False)
|
||||||
DEBUG_TRANSPORT_KWARGS = {}
|
DEBUG_TRANSPORT_KWARGS = {}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class FakeTestnetBlockchain(object):
|
||||||
if txhash != '6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54':
|
if txhash != '6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54':
|
||||||
raise Exception("Unexpected hash")
|
raise Exception("Unexpected hash")
|
||||||
|
|
||||||
t = proto_types.TransactionType(version = 1, lock_time = 0)
|
t = proto_types.TransactionType()
|
||||||
|
|
||||||
i = t.inputs.add()
|
i = t.inputs.add()
|
||||||
i.prev_hash = binascii.unhexlify('ee336e79153d51f4f3e45278f1f77ab29fd5bb135dce467282e2aff22cb9c570')
|
i.prev_hash = binascii.unhexlify('ee336e79153d51f4f3e45278f1f77ab29fd5bb135dce467282e2aff22cb9c570')
|
||||||
|
@ -34,6 +34,8 @@ class FakeTestnetBlockchain(object):
|
||||||
o.amount = 1000000000
|
o.amount = 1000000000
|
||||||
o.script_pubkey = binascii.unhexlify('76a91424a56db43cf6f2b02e838ea493f95d8d6047423188ac')
|
o.script_pubkey = binascii.unhexlify('76a91424a56db43cf6f2b02e838ea493f95d8d6047423188ac')
|
||||||
|
|
||||||
|
t.version = 1
|
||||||
|
t.lock_time = 0
|
||||||
return t
|
return t
|
||||||
|
|
||||||
class TestMsgSimplesigntx(common.TrezorTest):
|
class TestMsgSimplesigntx(common.TrezorTest):
|
||||||
|
|
|
@ -30,7 +30,7 @@ class BlockchainApi(object):
|
||||||
def get_tx(self, txhash):
|
def get_tx(self, txhash):
|
||||||
# Build protobuf transaction structure from blockchain.info
|
# Build protobuf transaction structure from blockchain.info
|
||||||
d = self._raw_tx(txhash)
|
d = self._raw_tx(txhash)
|
||||||
t = proto_types.TransactionType(version = 1, lock_time = 0)
|
t = proto_types.TransactionType()
|
||||||
|
|
||||||
for inp in d['inputs']:
|
for inp in d['inputs']:
|
||||||
di = self._raw_tx(inp['prev_out']['tx_index'])
|
di = self._raw_tx(inp['prev_out']['tx_index'])
|
||||||
|
@ -44,6 +44,8 @@ class BlockchainApi(object):
|
||||||
o.amount = output['value']
|
o.amount = output['value']
|
||||||
o.script_pubkey = binascii.unhexlify(output['script'])
|
o.script_pubkey = binascii.unhexlify(output['script'])
|
||||||
|
|
||||||
|
t.version = 1
|
||||||
|
t.lock_time = 0
|
||||||
return t
|
return t
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue