def test_to_xdr_obj(self): source = "GDL635DMMORJHKEHHQIIB4VPYM6YGEMPLORYHHM2DEHAUOUXLSTMHQDV" destination = "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ" op = AccountMerge(destination, source) assert ( op.to_xdr_object().to_xdr() == "AAAAAQAAAADX7fRsY6KTqIc8EIDyr8M9gxGPW6ODnZoZDgo6l1ymwwAAAAgAAAAAiZsoQO1WNsVt3F8Usjl1958bojiNJpTkxW7N3clg5e8=" )
def test_from_xdr_muxed(self): source = "GDL635DMMORJHKEHHQIIB4VPYM6YGEMPLORYHHM2DEHAUOUXLSTMHQDV" destination = "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ" destination2 = "GBL3NR5XNBNFAYVQMZ7R6RMUKLMGRUHNIYDYMEUPANQV6OROQXSDZYHV" origin_xdr_obj = AccountMerge(destination, source).to_xdr_object() restore_op = AccountMerge.from_xdr_object(origin_xdr_obj) assert restore_op.to_xdr_object().to_xdr() == origin_xdr_obj.to_xdr() assert ( restore_op._destination_muxed.to_xdr() == Keypair.from_public_key(destination).xdr_muxed_account().to_xdr() ) restore_op.destination = destination2 assert restore_op._destination_muxed is None assert restore_op.destination == destination2
def test_from_xdr_obj(self): source = "GDL635DMMORJHKEHHQIIB4VPYM6YGEMPLORYHHM2DEHAUOUXLSTMHQDV" destination = "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ" origin_xdr_obj = AccountMerge(destination, source).to_xdr_object() op = Operation.from_xdr_object(origin_xdr_obj) assert isinstance(op, AccountMerge) assert op.source == source assert op.destination == destination
def test_from_xdr_obj_muxed_account(self): source = "GDL635DMMORJHKEHHQIIB4VPYM6YGEMPLORYHHM2DEHAUOUXLSTMHQDV" destination = ( "MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY" ) origin_xdr_obj = AccountMerge(destination, source).to_xdr_object() op = Operation.from_xdr_object(origin_xdr_obj) assert isinstance(op, AccountMerge) assert op.source == source assert op.destination == destination