Skip to content

Commit

Permalink
Merge pull request #186 from terra-project/develop
Browse files Browse the repository at this point in the history
Release v0.2.2
  • Loading branch information
yys committed Jun 21, 2019
2 parents 0b3dba1 + 4893ffa commit 10f09c2
Show file tree
Hide file tree
Showing 43 changed files with 2,292 additions and 270 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a bug report to help us improve
title: "[BUG] title_of_bug"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Describe the steps to reproduce the behavior.

**Context & versions**
Delineate the correct versions of all the components involved in reproducing the bug.

**(if applicable) suggested solution**
If you know the solution to the bug, let us know!
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] title-of-feature "
labels: enhancement
assignees: ''

---

**Problem definition**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Feature specification**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
** Summary of changes **

<Describe summary of major changes here>

** Report of required housekeeping **

- [ ] Github issue OR spec proposal link
- [ ] Wrote tests
- [ ] Updated relevant documentation (docs/)
- [ ] Added a relevant changelog entry: clog add [section] [stanza] [message]

======

** (FOR ADMIN) Before merging **

- [ ] Added appropriate labels to PR
- [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
- [ ] Confirm added tests are consistent with the intended behavior of changes
- [ ] Ensure all tests pass
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## 0.2.2

- [\#185](https://github.com/terra-project/core/pull/185): Improve oracle specs
- [\#184](https://github.com/terra-project/core/pull/184): Fix `terracli` docs
- [\#183](https://github.com/terra-project/core/pull/183): Change all GradedVestingAccounts to LazyGradedVestingAccounts.
- [\#179](https://github.com/terra-project/core/pull/179): Conform querier responses to be returned in JSON format
- [\#178](https://github.com/terra-project/core/pull/178): Change BIP44 PATH to 330

### Changes
#### [\#185](https://github.com/terra-project/core/pull/185) Oracle `MsgFeederDelegatePermission` specs
Added docs for using `MsgFeederDelegatePermission` to oracle specs

#### [\#185](https://github.com/terra-project/core/pull/185) Oracle price vote denom error fix
Oracle specs now specify micro units `uluna` and `uusd` for correct denominations for price prevotes and votes

#### [\#184](https://github.com/terra-project/core/pull/184) Minor terracli fix

#### [\#183](https://github.com/terra-project/core/pull/183) Oracle param update
```
OracleRewardBand: 1% => 2%
```

#### [\#183](https://github.com/terra-project/core/pull/183) Market param update
```
DailyLunaDeltaCap: 0.5% => 0.1%
```

#### [\#183](https://github.com/terra-project/core/pull/183) LazyGradedVestingAccount

* Spread out the cliffs for presale investors, with varying degrees of severity (details [\#180](https://github.com/terra-project/core/issues/180))

#### [\#179](https://github.com/terra-project/core/pull/179) Align Querier responses to JSON

* Querier was returning misaligned formats for return values, now aligned to JSON format

#### [\#178](https://github.com/terra-project/core/pull/178) Correctly use 330 as the coin type field in BIP 44 PATH

* We were previously using the Cosmos coin type field for the BIP44 path. Changed to Terra's own 330.


## 0.2.1

- [\#166](https://github.com/terra-project/core/pull/166): Newly added parameters were not being added to the columbus-2 genesis.json file. Fixed.
Expand Down
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"sort"

"github.com/terra-project/core/types"
"github.com/terra-project/core/update"
"github.com/terra-project/core/version"
"github.com/terra-project/core/x/budget"
"github.com/terra-project/core/x/market"
Expand Down Expand Up @@ -335,6 +336,9 @@ func (app *TerraApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.
treasuryTags := treasury.EndBlocker(ctx, app.treasuryKeeper)
tags = append(tags, treasuryTags...)

updateTags := update.EndBlocker(ctx, app.accountKeeper, app.oracleKeeper, app.marketKeeper)
tags = append(tags, updateTags...)

if app.assertInvariantsBlockly {
app.assertRuntimeInvariants()
}
Expand Down
42 changes: 30 additions & 12 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ type GenesisAccount struct {
AccountNumber uint64 `json:"account_number"`

// vesting account fields
OriginalVesting sdk.Coins `json:"original_vesting"` // total vesting coins upon initialization
DelegatedFree sdk.Coins `json:"delegated_free"` // delegated vested coins at time of delegation
DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation
StartTime int64 `json:"start_time"` // vesting start time (UNIX Epoch time)
EndTime int64 `json:"end_time"` // vesting end time (UNIX Epoch time)
VestingSchedules []types.VestingSchedule `json:"vesting_schedules"` // vesting end time (UNIX Epoch time)
OriginalVesting sdk.Coins `json:"original_vesting"` // total vesting coins upon initialization
DelegatedFree sdk.Coins `json:"delegated_free"` // delegated vested coins at time of delegation
DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation
StartTime int64 `json:"start_time"` // vesting start time (UNIX Epoch time)
EndTime int64 `json:"end_time"` // vesting end time (UNIX Epoch time)
VestingSchedules []types.VestingSchedule `json:"vesting_schedules"` // vesting schedule (clif: UNIX Epoch time, ratio: dec)
LazyVestingSchedules []types.LazyVestingSchedule `json:"lazy_vesting_schedules"` // lazy vesting schedule (start_time&end_time: UNIX Epoch time, ratio: dec)
}

// NewGenesisAccount returns new genesis account
Expand All @@ -122,15 +123,21 @@ func NewGenesisAccountI(acc auth.Account) GenesisAccount {

vacc, ok := acc.(auth.VestingAccount)
if ok {
gacc.OriginalVesting = vacc.GetOriginalVesting()
gacc.DelegatedFree = vacc.GetDelegatedFree()
gacc.DelegatedVesting = vacc.GetDelegatedVesting()
gacc.StartTime = vacc.GetStartTime()
gacc.EndTime = vacc.GetEndTime()

gvacc, ok := vacc.(types.GradedVestingAccount)
if ok {
gacc.OriginalVesting = gvacc.GetOriginalVesting()
gacc.DelegatedFree = gvacc.GetDelegatedFree()
gacc.DelegatedVesting = gvacc.GetDelegatedVesting()
gacc.StartTime = gvacc.GetStartTime()
gacc.EndTime = gvacc.GetEndTime()
gacc.VestingSchedules = gvacc.GetVestingSchedules()
}

lgvacc, ok := vacc.(types.LazyGradedVestingAccount)
if ok {
gacc.LazyVestingSchedules = lgvacc.GetLazyVestingSchedules()
}
}

return gacc
Expand Down Expand Up @@ -163,11 +170,16 @@ func (ga *GenesisAccount) ToAccount() auth.Account {
return &auth.DelayedVestingAccount{
BaseVestingAccount: baseVestingAcc,
}
} else {
} else if ga.VestingSchedules != nil {
return &types.BaseGradedVestingAccount{
BaseVestingAccount: baseVestingAcc,
VestingSchedules: ga.VestingSchedules,
}
} else if ga.LazyVestingSchedules != nil {
return &types.BaseLazyGradedVestingAccount{
BaseVestingAccount: baseVestingAcc,
LazyVestingSchedules: ga.LazyVestingSchedules,
}
}
}

Expand Down Expand Up @@ -307,6 +319,12 @@ func validateGenesisStateAccounts(accs []GenesisAccount) error {
return fmt.Errorf("schedule is invalid for vesting account; address: %s, denom: %s", addrStr, vestingSchedule.GetDenom())
}
}
} else if acc.LazyVestingSchedules != nil && len(acc.LazyVestingSchedules) > 0 {
for _, lazyVestingSchedule := range acc.LazyVestingSchedules {
if !lazyVestingSchedule.IsValid() {
return fmt.Errorf("lazy schedule is invalid for vesting account; address: %s, denom: %s", addrStr, lazyVestingSchedule.GetDenom())
}
}
} else {
if acc.EndTime == 0 {
return fmt.Errorf("missing end time for vesting account; address: %s", addrStr)
Expand Down
Loading

0 comments on commit 10f09c2

Please sign in to comment.