def test_override_transfer(self):
     s = {
         "fee": {
             "amount": 0,
             "asset_id": "1.3.0"
         },
         "issuer": "1.2.29",
         "from": "1.2.104",
         "to": "1.2.29",
         "amount": {
             "amount": 100000,
             "asset_id": "1.3.105"
         },
         "extensions": []
     }
     op = operations.Override_transfer(**s)
     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")
     compare = ("f68585abf4dce7c8045701260000000000000000001d681da086"
                "01000000000069000000012030cc81722c3e67442d2f59deba18"
                "8f6079c8ba2d8318a642e6a70a125655515f20e2bd3adb2ea886"
                "cdbc7f6590c7f8c80818d9176d9085c176c736686ab6c9fd")
     self.assertEqual(compare[:-130], txWire[:-130])
Exemplo n.º 2
0
    def seize(self, from_account, to_account, amount):
        """ Seize amount from an account and send to another

            ... note:: This requires the ``override_authority`` to be
                       set for this asset!

            :param bitshares.account.Account from_account: From this account
            :param bitshares.account.Account to_account: To this account
            :param bitshares.amount.Amount amount: Amount to seize
        """

        options = self["options"]
        if not (options["flags"] & asset_permissions["override_authority"]):
            raise Exception("Insufficient Permissions/flags for seizure!")

        op = operations.Override_transfer(
            **{
                "fee": {
                    "amount": 0,
                    "asset_id": "1.3.0"
                },
                "issuer": self["issuer"],
                "from": from_account["id"],
                "to": to_account["id"],
                "amount": amount.json(),
                "extensions": []
            })
        return self.bitshares.finalizeOp(op, self["issuer"], "active")
Exemplo n.º 3
0
 def test_override_transfer(self):
     self.op = operations.Override_transfer(**{
         "fee": {"amount": 0,
                 "asset_id": "1.3.0"},
         "issuer": "1.2.29",
         "from": "1.2.104",
         "to": "1.2.29",
         "amount": {"amount": 100000,
                    "asset_id": "1.3.105"},
         "extensions": []
     })
     self.cm = ("f68585abf4dce7c8045701260000000000000000001d681da086"
                "01000000000069000000012030cc81722c3e67442d2f59deba18"
                "8f6079c8ba2d8318a642e6a70a125655515f20e2bd3adb2ea886"
                "cdbc7f6590c7f8c80818d9176d9085c176c736686ab6c9fd")
     self.doit()