Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow vest portion of allocated fund in account #29

Merged
merged 3 commits into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- [29](https://github.com/crypto-com/pystarport/pull/29) Allow vesting portion of the allocated fund in account
- [28](https://github.com/crypto-com/pystarport/pull/28) Support overwrite default relayer config with configs used to setup chains
- [13](https://github.com/crypto-com/pystarport/issues/13) Support configure start command flags
- [19](https://github.com/crypto-com/pystarport/issues/19) Support `config` to patch `config.toml` for each validator
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ chainmaind:
coins: 200cro
- name: reserve
coins: 200cro
vesting_coins: 100cro # if not provided, the all of coins will be vested
vesting: "1d"
- name: launch
coins: 100cro
Expand Down
4 changes: 3 additions & 1 deletion pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,12 @@ def create_account(cli, account, use_ledger=False):
seconds=durations.Duration(vesting).to_seconds()
)
vend = int(end_time.timestamp())
# allow vest only some of coins allocated, where account["coins"] must larger than account["vesting_coins"] if any vesting_coins specified in config.yaml.
vesting_amount = account.get("vesting_coins", account["coins"])
cli.add_genesis_account(
acct["address"],
account["coins"],
vesting_amount=account["coins"],
vesting_amount=vesting_amount,
vesting_end_time=vend,
)
return acct
Expand Down