def test_block_2(self): # https://www.nanode.co/block/2568bf76336f7a415ca236dab97c1df9de951ca057a2e79df1322e647a259e7b self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ proto.ButtonRequest( code=proto_types.ButtonRequest_ConfirmOutput), proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, parent_link=unhexlify( '491fca2c69a84607d374aaf1f6acd3ce70744c5be0721b5ed394653e85233507' ), parent_representative=REP_OFFICIAL_1, parent_balance=96242336390000000000000000000, representative=REP_NANODE, balance=96242336390000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), '2568bf76336f7a415ca236dab97c1df9de951ca057a2e79df1322e647a259e7b' ) self.assertEqual( hexlify(res.signature), '3a0687542405163d5623808052042b3482360a82cc003d178a0c0d8bfbca86450975d0faec60ae5ac37feba9a8e2205c8540317b26f2c589c2a6578b03870403' )
def test_block_1(self): # https://www.nanode.co/block/f9a323153daefe041efb94d69b9669c882c935530ed953bbe8a665dfedda9696 self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ proto.ButtonRequest( code=proto_types.ButtonRequest_ConfirmOutput), proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, link_hash=unhexlify( '491fca2c69a84607d374aaf1f6acd3ce70744c5be0721b5ed394653e85233507' ), representative=REP_OFFICIAL_1, balance=96242336390000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), 'f9a323153daefe041efb94d69b9669c882c935530ed953bbe8a665dfedda9696' ) self.assertEqual( hexlify(res.signature), 'd247f6b90383b24e612569c75a12f11242f6e03b4914eadc7d941577dcf54a3a7cb7f0a4aba4246a40d9ebb5ee1e00b4a0a834ad5a1e7bef24e11f62b95a9e09' )
def test_block_6(self): # https://www.nanode.co/block/a7e59d38b001d9348dbe16fa866d0b435259d381af1db019f3ff83fd7590e226 self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, grandparent_hash=unhexlify( '32ac7d8f5a16a498abf203b8dfee623c9e111ff25e7339f8cd69ec7492b23edd' ), parent_link=unhexlify(NANO_ACCOUNT_1_PUBLICKEY), parent_representative=REP_NANODE, parent_balance=86242336390000000000000000000, link_recipient_n=OTHER_ACCOUNT_3_PATH, representative=REP_NANODE, balance=40000760000000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), 'a7e59d38b001d9348dbe16fa866d0b435259d381af1db019f3ff83fd7590e226' ) self.assertEqual( hexlify(res.signature), '1dcd8a27aeac1cab9a2054d5cc6df1b80be46290596dcf6d195c2c286b1615d4139276f9be9c6f202ee1ee8a5569b4a4fc838b1d7306aa71c8e431a6b8075707' )
def test_block_5(self): # https://www.nanode.co/block/5d732d843c22f806011127655790484dbabd38dda20b24900c053c3dfc12523f self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, grandparent_hash=unhexlify( '1ca240212838d053ecaa9dceee598c52a6080067edecaeede3319eb0b7db6525' ), parent_link=unhexlify(RECIPIENT_DONATIONS_PUBLICKEY), parent_representative=REP_NANODE, parent_balance=126242336390000000000000000000, link_recipient_n=NANO_ACCOUNT_1_PATH, representative=REP_NANODE, balance=86242336390000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), '5d732d843c22f806011127655790484dbabd38dda20b24900c053c3dfc12523f' ) self.assertEqual( hexlify(res.signature), '3fb596c34db1241201983cbf613fe9b68a6eae2420c7f294c7e883574fda10d5cc19c9e516b57ed0cbc5e7d3438f70f2ddd7a45bf3e693ff800b97e187de5701' )
def test_block_4(self): # https://www.nanode.co/block/32ac7d8f5a16a498abf203b8dfee623c9e111ff25e7339f8cd69ec7492b23edd self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, grandparent_hash=unhexlify( '2568bf76336f7a415ca236dab97c1df9de951ca057a2e79df1322e647a259e7b' ), parent_link=unhexlify( 'd7384845d2ae530b45a5dd50ee50757f988329f652781767af3f1bc2322f52b9' ), parent_representative=REP_NANODE, parent_balance=196242336390000000000000000000, link_recipient=RECIPIENT_DONATIONS, representative=REP_NANODE, balance=126242336390000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), '32ac7d8f5a16a498abf203b8dfee623c9e111ff25e7339f8cd69ec7492b23edd' ) self.assertEqual( hexlify(res.signature), 'bcb806e140c9e2bc71c51ebbd941b4d99cee3d97fd50e3006eabc5e325c712662e2dc163ee32660875d67815ce4721e122389d2e64f1c9ad4555a9d3d8c33802' )
def test_block_3(self): # https://www.nanode.co/block/1ca240212838d053ecaa9dceee598c52a6080067edecaeede3319eb0b7db6525 self.setup_mnemonic_nopin_nopassphrase() with self.client: self.client.set_expected_responses([ # Receive doesn't produce a proto.ButtonRequest proto_nano.NanoSignedTx(), ]) res = self.client.nano_sign_tx( 'Nano', NANO_ACCOUNT_0_PATH, grandparent_hash=unhexlify( 'f9a323153daefe041efb94d69b9669c882c935530ed953bbe8a665dfedda9696' ), parent_link=unhexlify( '0000000000000000000000000000000000000000000000000000000000000000' ), parent_representative=REP_NANODE, parent_balance=96242336390000000000000000000, link_hash=unhexlify( 'd7384845d2ae530b45a5dd50ee50757f988329f652781767af3f1bc2322f52b9' ), representative=REP_NANODE, balance=196242336390000000000000000000, ) self.assertIsInstance(res, proto_nano.NanoSignedTx) self.assertEqual( hexlify(res.block_hash), '1ca240212838d053ecaa9dceee598c52a6080067edecaeede3319eb0b7db6525' ) self.assertEqual( hexlify(res.signature), 'e980d45365ae2fb291950019f7c19a3d5fa5df2736ca7e7ca1984338b4686976cb7efdda2894ddcea480f82645b50f2340c9d0fc69a05621bdc355783a21820d' )