Exemplo n.º 1
0
    def test_serialize_multisig_outpoint(self):
        outpoint = MultiSigOutpoint(2, 3,
                                    [PublicKey.from_hexstr("022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"), 
                                     PublicKey.from_hexstr("022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"), 
                                     PublicKey.from_hexstr("029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f")])
        
        serialized = MultiSigOutpointSerializer.serialize(outpoint)

        self.assertEquals(hexstr(serialized), 
                          "0000000200000003022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f")
Exemplo n.º 2
0
    def test_deserialize_multisig_outpoint(self):
        serialized_data = decodehexstr("0000000200000003022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f")
        
        outpoint = MultiSigOutpointSerializer.deserialize(serialized_data)

        self.assertEquals(outpoint, 
                          MultiSigOutpoint(2, 3,
                                    [PublicKey.from_hexstr("022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"), 
                                     PublicKey.from_hexstr("022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"), 
                                     PublicKey.from_hexstr("029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f")])
                          )
Exemplo n.º 3
0
    def test_serialize_multisig_outpoint(self):
        outpoint = MultiSigOutpoint(2, 3, [
            PublicKey.from_hexstr(
                "022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
            ),
            PublicKey.from_hexstr(
                "022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
            ),
            PublicKey.from_hexstr(
                "029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
            )
        ])

        serialized = MultiSigOutpointSerializer.serialize(outpoint)

        self.assertEquals(
            hexstr(serialized),
            "0000000200000003022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
        )
Exemplo n.º 4
0
    def test_deserialize_multisig_outpoint(self):
        serialized_data = decodehexstr(
            "0000000200000003022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
        )

        outpoint = MultiSigOutpointSerializer.deserialize(serialized_data)

        self.assertEquals(
            outpoint,
            MultiSigOutpoint(2, 3, [
                PublicKey.from_hexstr(
                    "022af4cc9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
                ),
                PublicKey.from_hexstr(
                    "022dc45c9ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
                ),
                PublicKey.from_hexstr(
                    "029ce0129ec3358354345c91694031a1fcdbe9a9064197521814e8a20fe018eb5f"
                )
            ]))