Beispiel #1
0
 def test_vesting_withdraw(self):
     self.op = operations.Vesting_balance_withdraw(**{
         "fee": {"amount": 0, "asset_id": "1.3.0"},
         "vesting_balance": "1.13.0",
         "owner": "1.2.0",
         "amount": {"amount": 0, "asset_id": "1.3.0"},
         "prefix": "TEST"
     })
     self.cm = ("f68585abf4dce7c80457012100000000000000000000"
                "0000000000000000000000011f07ae9b0d1cb494e248"
                "6b99cccdf78ef8b785522af8f2233de364d4455c0626"
                "935d2d32414a2f7a6b9cdf3451730062965adeec8aa2"
                "03fca97f608411dce84309")
     self.doit()
Beispiel #2
0
    def compareConstructedTX(self):
        #    def test_online(self):
        #        self.maxDiff = None
        op = operations.Vesting_balance_withdraw(
            **{
                "fee": {
                    "amount": 0,
                    "asset_id": "1.3.0"
                },
                "vesting_balance": "1.13.0",
                "owner": "1.2.0",
                "amount": {
                    "amount": 0,
                    "asset_id": "1.3.0"
                },
                "prefix": "TEST"
            })
        ops = [Operation(op)]
        tx = Signed_Transaction(ref_block_num=ref_block_num,
                                ref_block_prefix=ref_block_prefix,
                                expiration=expiration,
                                operations=ops)
        tx = tx.sign([wif], chain=prefix)
        tx.verify([PrivateKey(wif).pubkey], "BTS")
        txWire = hexlify(bytes(tx)).decode("ascii")
        print("=" * 80)
        pprint(tx.json())
        print("=" * 80)

        from grapheneapi.grapheneapi import GrapheneAPI
        rpc = GrapheneAPI("localhost", 8092)
        compare = rpc.serialize_transaction(tx.json())
        print(compare[:-130])
        print(txWire[:-130])
        print(txWire[:-130] == compare[:-130])
        self.assertEqual(compare[:-130], txWire[:-130])