mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
Fixed address_n
This commit is contained in:
parent
5f0bf64bfa
commit
53ffe3b755
@ -6,7 +6,7 @@ import bitkeylib.bitkey_pb2 as proto
|
|||||||
class TestSignTx(common.BitkeyTest):
|
class TestSignTx(common.BitkeyTest):
|
||||||
def test_signtx(self):
|
def test_signtx(self):
|
||||||
inp1 = proto.TxInput(index=0,
|
inp1 = proto.TxInput(index=0,
|
||||||
address_n=[1,],
|
address_n=[1,0],
|
||||||
amount=100000000,
|
amount=100000000,
|
||||||
prev_hash='prevhash1234354346543456543654',
|
prev_hash='prevhash1234354346543456543654',
|
||||||
prev_index=11,
|
prev_index=11,
|
||||||
@ -14,7 +14,7 @@ class TestSignTx(common.BitkeyTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
inp2 = proto.TxInput(index=1,
|
inp2 = proto.TxInput(index=1,
|
||||||
address_n=[2,],
|
address_n=[2,0],
|
||||||
amount=100000000,
|
amount=100000000,
|
||||||
prev_hash='prevhash2222254346543456543654',
|
prev_hash='prevhash2222254346543456543654',
|
||||||
prev_index=11,
|
prev_index=11,
|
||||||
@ -22,7 +22,7 @@ class TestSignTx(common.BitkeyTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
out1 = proto.TxOutput(index=0,
|
out1 = proto.TxOutput(index=0,
|
||||||
address='1Bitkey',
|
address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx',
|
||||||
#address_n=[],
|
#address_n=[],
|
||||||
amount=100000000,
|
amount=100000000,
|
||||||
script_type=proto.PAYTOADDRESS,
|
script_type=proto.PAYTOADDRESS,
|
||||||
@ -30,14 +30,21 @@ class TestSignTx(common.BitkeyTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
out2 = proto.TxOutput(index=1,
|
out2 = proto.TxOutput(index=1,
|
||||||
address='1Bitkey2',
|
address='1BitkeyP2nDd5oa647AjvBbbwST54W5Zmx',
|
||||||
#address_n=[],
|
#address_n=[],
|
||||||
amount=100000000,
|
amount=100000000,
|
||||||
script_type=proto.PAYTOADDRESS,
|
script_type=proto.PAYTOADDRESS,
|
||||||
#script_args=
|
#script_args=
|
||||||
)
|
)
|
||||||
|
|
||||||
print self.bitkey.sign_tx([inp1, inp2], [out1, out2])
|
out3 = proto.TxOutput(index=2,
|
||||||
|
address='1MVgq4XaMX7PmohkYzFEisH1D7uxTiPbFK',
|
||||||
|
address_n=[2, 1],
|
||||||
|
amount=100000000,
|
||||||
|
script_type=proto.PAYTOADDRESS,
|
||||||
|
#script_args=
|
||||||
|
)
|
||||||
|
print self.bitkey.sign_tx([inp1, inp2], [out1, out2, out3])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
Loading…
Reference in New Issue
Block a user