cryptonomex / graphene

MIT License
1.05k stars 337 forks source link

`vesting_balance_create` unclear #622

Closed xeroc closed 8 years ago

xeroc commented 8 years ago

I did some testing with vesting_balance_create and ran into the issue that no matter what policies and parameters I pick, I cannot get to a point where I can claim something back from the vesting balance after a given time.

You can see my experiments in the testnet: http://testnet.bitshares.eu/#/account/maker/vesting/

What I would like to achieve is a simple vesting balance for someone else with say $100 that vests over 1 year.

Also, how could I deposit into a vesting balance? I have read in the code that one of both policies allowed that.

theoreticalbts commented 8 years ago

The best place to look for information on creating vesting balances is in this unit test. My suggestion is to idump( (trx) ); at many places in this code, then compile and run with

make chain_test
tests/tests/chain_test -t '*/vesting_balance_withdraw_test'

If you can post the result of running from cli_wallet:

get_vesting_balances maker

it would also be helpful. I suspect this may be UI bug(s).

xeroc commented 8 years ago

It was indeed a UI bug get_vesting_balances does the trick. I'll investigate in the UI

Thanks!

xeroc commented 8 years ago

I have a feeling that coin_seconds_earned is not updates because I saw no coins earned for any of my vesting balances!

{
    "id": "1.13.84",
    "owner": "1.2.104",
    "balance": {
      "amount": 725000,
      "asset_id": "1.3.0"
    },
    "policy": [
      1,{
        "vesting_seconds": 300,
        "start_claim": "2016-03-16T11:52:10",
        "coin_seconds_earned": "0",
        "coin_seconds_earned_last_update": "2016-03-16T11:53:45"
      }
    ],
    "allowed_withdraw": {
      "amount": 725000,
      "asset_id": "1.3.0"
    },
    "allowed_withdraw_time": "2016-03-16T12:09:00"
  }

coin_seconds_earned is 0 but I am allowed to withdraw funds.

Hence, it seems to be an issue with the database api.