def _setupvesting(): creator = Account("foundation") owner = Account("init0") amount = Amount("10000000 DNA") op = operations.Vesting_balance_create( **{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "creator": creator["id"], "owner": owner["id"], "amount": amount.json(), "policy": [3, { "duration": 60 * 60 * 24 * 365 }], "extensions": [], }) try: click.echo(blockchain.finalizeOp(op, creator, "active")) click.echo("Vested!") except Exception as e: click.echo(click.style(str(e), fg="red"))
def test_json(self): amount = Amount("1", self.symbol) self.assertEqual( amount.json(), { "asset_id": self.asset["id"], "amount": 1 * 10 ** self.precision })