Commit Graph

1476 Commits

Author SHA1 Message Date
Adam Robert Turman
ae70dce2b1
Merge pull request #1010 from Kava-Labs/at-swagger
removed duplicate line and added correct endpoint description in swagger
2021-08-25 17:19:11 -05:00
adamrturman
7a00dcd06c removed duplicate line and added correct endpoint description 2021-08-25 15:45:41 -05:00
Kevin Davis
dd03ba5671
Add supply migration for kava-8 (#1008)
* fix: update supply migration to add swp token supply

* add full migration test with app initialization

* fix: use correct chain-id in test app initialization

* address review comments
2021-08-24 16:33:10 -05:00
Jewcub
a9c77f0282
update cn migration guide (#1007) 2021-08-19 23:43:38 -06:00
Kevin Davis
c75b03a815
feat: add upgrade block height to migration guide 2021-08-19 23:21:30 -06:00
Kevin Davis
4e6e94887c
fix: update downgrade version in migration 2021-08-19 23:19:03 -06:00
Kevin Davis
8f0a7ccf19
fix: replace placeholder in migration guide 2021-08-19 23:13:42 -06:00
Kevin Davis
a13fefe00b
feat: add versions to migration guide 2021-08-19 23:11:35 -06:00
Ruaridh
a52f606447
Incentive migration state fixes: delegator (#1004)
* add missing delegator claims

* fix tests
2021-08-20 04:13:59 +01:00
Ruaridh
7d85361240
Fix hard incentive state in migrations (#1001)
* extract hard claim migration function

* tidy up claim delegator index migration

* fix invalid hard claims

* fix comment missed in merge conflict reolution

* fix tests
2021-08-20 03:12:34 +01:00
Kevin Davis
3d65ba7caa
feat: add swap incentives (#1006)
* feat: add swap incentives

* add tests that verify swp annual rewards

* remove unused testdata file

* add test for swp delegator rewards
2021-08-19 12:33:40 -06:00
Ruaridh
22843cd3df
Incentive migration state fixes: USDX Minting (#998)
* minor migration refactor

* overwrite usdx claims with latest reward indexes

* add missing usdx claims in migration

* add script to calculate missing usdx rewards

* generate missing rewards using preliminary data

* add missing usdx rewards in migration

* update missing rewards data to use correct genesis

* test rewards were not decreased

* add tests for missing reward calculations

* clarify function names

* test to assert total new rewards are as expected

* remove unecessary todo item
2021-08-19 16:20:26 +01:00
Kevin Davis
cac7398120
Add swp token distribution (#1003)
* implement swp airdrop to usdx depositors to hard

* verify swp airdrop amount, total supply, affected users

* remove unused test code

* add map as go file

* update tests to use stored variable

* re-add snapshot test

* update snapshot testdata

* remove unused code for generating swp airdrop map

* remove snapshot test

* add swp token distribution

* bump test timeouts

* address review comments

* use global variables to simplify testing assertions on swp supply

* optional: swp migration test and small refactor (#1005)

* add test to ensure balances are not decreased

* simplify slice manipulation

* bump context deadline in circleci

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
2021-08-18 23:10:58 -06:00
Denali Marsh
346501aa58
update quorum to 10% (#1002) 2021-08-18 07:30:45 -06:00
Denali Marsh
0714d6120e
Certik audit revisions (#999)
* revisions: BAS-01 | Inconsistent Comment

* revisions: GEE-01 | Unsorted imports

* revisions: KEE-01 | Ambiguous Function Naming

* revisions: OPE-01 | Redundant “if” Clause
2021-08-18 06:51:09 -06:00
Kevin Davis
61b7f8f56e
SWP airdrop for USDX suppliers to hard (#996)
* implement swp airdrop to usdx depositors to hard

* verify swp airdrop amount, total supply, affected users

* remove unused test code

* add map as go file

* update tests to use stored variable

* re-add snapshot test

* update snapshot testdata

* remove unused code for generating swp airdrop map

* remove snapshot test
2021-08-17 11:59:07 -06:00
Nick DeLuca
63508d79f9
Fix Account Migration for Additive Vesting Periods (#993)
* update acceptance test to fail

* update periodic vesting reset to reflect additive period lengths, not
absolute lengths

* simplify end time logic

* remove log

* test inclusion of v0_15 migration tests
2021-08-16 12:25:15 -06:00
Denali Marsh
30af22b50b
Initial kava 8 migration (#985)
* add swap module, update incentive

* add swapRewardPeriods to incentive

* add TODOs

* add text change permissions to hard, swap coms

* rename variable to clarify delegation rewards

* remove placeholder swp incentives

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-08-16 10:34:30 -06:00
Kevin Davis
1a90c3bec6
add state to swap genesis (#997) 2021-08-16 10:14:48 -06:00
Jewcub
cd2827dbe7
translation (#991)
* translation

* Chinese typos
2021-08-16 07:26:07 -06:00
dependabot[bot]
536049500f
build(deps): bump url-parse from 1.5.1 to 1.5.3 in /docs (#995)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 17:26:47 -06:00
dependabot[bot]
e292215b79
build(deps): bump path-parse from 1.0.6 to 1.0.7 in /docs (#992)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-12 14:00:52 -06:00
Kevin Davis
e060393563
fix: update claim multipliers in incentive migration (#994) 2021-08-12 14:00:19 -06:00
Nick DeLuca
8b54fdafa4
Reset Periodic Vesting Accounts for Kava-8 (#987)
* add auth test data

* add periodic vesting account migration

* assert owned coins are equal and unchanged during migration

* add script for generating test data from a genesis file

* remove commented import

* touch ups

* don't pretty print test data for auth module; update generate script to
use jq -c option

* fix typo in comment, improve clarity of assertions

* add context to migrate auth assertions

* add 180 days check for spendable coins

* asssertion context

* pr feedback - add assertions, touch up assertion msgs, and fix migration test to correctly
type assert pointer
2021-08-12 10:31:58 -05:00
Ruaridh
58b3089ecd
Remove unnecessary msg field in incentive (#988)
* remove msg field that was forgotten

* fix cli tx example text
2021-08-10 22:56:19 -06:00
Kevin Davis
5981e61296
fix: typo in attribute key (#986) 2021-08-10 11:59:19 -06:00
Denali Marsh
b72815387a
Update committee spec (#981)
* concepts

* messages

* events

* begin block

* address revisions

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-08-10 07:46:49 -06:00
Denali Marsh
69cd624e97
Initial v0_15 migration/rollback guides (#975)
* v0_15 migration/rollback guides

* address revisions

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-08-10 07:39:50 -06:00
Denali Marsh
c16d7875aa
Update Swagger documentation for kava-8 launch (#983)
* swap queries

* swap txs

* update committee types

* committee queries

* incentive txs

* fix: add swap module to tags

* fix: point to stable mainnet host

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-08-06 08:12:20 -06:00
Denali Marsh
2167b13430
update incentive spec (#982) 2021-08-06 08:12:08 -06:00
Nick DeLuca
b86cfc9f14
Add Invariants for Swap Module (#979)
* add swap module invariants

* typo

* update alias file for invariants

* typo in test name

* fix typo - method iterates share record, not pools
2021-08-05 20:43:55 -05:00
Denali Marsh
56463eca14
update committee allowed paramas (#978) 2021-08-05 07:53:56 -06:00
Ruaridh
20560a16d7
fix test setup to use new Multipliers type (#984) 2021-08-04 19:02:59 +01:00
Ruaridh
63c8421a81
Separate multipliers per claimed denom (#971)
* move multipliers to their own file

* add multipliers per denom to MsgClaimHardReward

* claim with multipliers per denom for hard claims

* remove unused error

* add multipliers per denom to params
connect to to hard claiming

* temporary fix migration

* update usdx claiming for new multiplier params

* claim with multipliers per denom for delegator

* claim with multipliers per denom for swap rewards

* tidy up multiplier name validation

* rename new multipliers field in params

* remove old multpliers from params

* clear up various TODOs

* add tags to new structs

* remove dead code
2021-08-04 15:55:29 +01:00
Denali Marsh
6bcc843c2e
Add SAFU fund to circulating supply (#980)
* add safu fund to circulating supply

* add parentheses
2021-08-04 13:36:03 +02:00
Denali Marsh
c252a1b99b
Swap module simulations: swap msg operations (#972)
* simulate MsgSwapExactForTokens

* extract deadline generation to custom method

* simulate MsgSwapForExactTokens

* implement simulation decoder

* decoder test

* add fee to msgs

* update comments
2021-07-27 12:57:23 +02:00
Ruaridh
b2bfe05170
Fix bug in syncing swap rewards (#977)
* fix bug in GetSyncedSwapClaim
It did not sync rewards for pools that had recently had rewards added

* remove dead code
2021-07-26 14:07:18 -06:00
Ruaridh
dc6f5c6c83
Fix incentive usdx/borrow/supply reward calculation bug (#974)
* extract borrow sync logic into separate func

* fix borrow reward calculations
Use the normalized borrow as the source shares in reward calculations.

* extract supply sync logic into separate func

* prepare to fix supply reward calculations

* fix deposit reward calculations
Use the normalized deposit as the source shares in reward calculations.

* extract usdx sync logic into separate func

* prepare to fix usdx reward calculations

* fix cdp reward calculations
Use the normalized cdp debt as the source shares in reward calculations.

* fix compile error from messed up partial stage

* Fix incentive usdx reward bug (#976)

* minor test refactors

* fix overpayment bug
Init methods should not read params.
Add test to cover bug

* fix typos
2021-07-26 20:07:24 +01:00
Kevin Davis
6d546d6a96
Update Readme with latest kava mainnet version 2021-07-22 12:40:45 -06:00
Ruaridh
6f193c7f2a
Refactor incentive accumulators to be the same (#970)
* add test for validate multi reward periods

* tidy up: combine files

* don't accumulate global indexes containing zeros
Previously if the time since last block was 0,
indexes were added containing 0s.
Now leave them out. Missing is assumed to be 0.

* move state independent test to types folder

* clarify reward source concept to "source shares"
- rename variables and update doc comments
- extract method from swap accumulation

* tidy up and expand swap accumulation unit tests

* rename swap test file to match others

* update swap pool id format in tests

* refactor borrow accumulation, use new accumulator

* refactor supply accumulation, use new accumulator

* refactor delegator accumulation, use accumulator

* refactor usdx accumulation, use new accumulator

* fix types const

* remove unsed methods

* more usdx minting param validation.
Protect against the rewards per second denom changing.
It should always be "ukava".

* add safety check in InitGenesis
It prevents huge accumulations on the first block by limiting all
previous accumulation times to be within one year of genesis

* add todo for adding swp token distirbution info
2021-07-22 13:53:18 +01:00
Nick DeLuca
cbb8b04292
Update Pool ID Separator (#968)
* update state store key separator and extract pool key sep

* update state key separater and pool id seperator to not conflict with
'/' in ibc vouchers

* fix pool ids for updated sep
2021-07-15 19:09:35 -05:00
Kevin Davis
2bbdcbb365
update swap spec: add msgs, state, events (#966) 2021-07-15 17:34:16 -05:00
Nick DeLuca
911f9f59d6
Hook Regression Test + Deposit Refactor (#967)
* add regression test for hooks; refactor deposit to commit pool and
shares in one place with commit after validation checks; panic on pool
and share set methods if the record is invalid

* use correct hook ordering; add regression test for order - fails if
hooks are not called before or after share record set
2021-07-15 17:29:11 -05:00
Kevin Davis
da5a852a6c
Misc simulation fixes (#963)
* fix: catch min swap edge case in bep3 sims

* fix: check repayment is above min in cdp sims

* remove print statement
2021-07-15 10:46:56 -05:00
Kevin Davis
290cb61882
feat: backport swap sims for deposit, withdraw (#965)
* sims: MsgDeposit operation

* implement withdraw

* update comment

* fix: add interest factors to cdp sims

Co-authored-by: denalimarsh <denalimarsh@gmail.com>
2021-07-15 10:35:24 -05:00
Kevin Davis
bb1bc7fed4
fix: update swap genesis in test (#964) 2021-07-15 10:03:30 -05:00
Kevin Davis
d45fa58f5c
Swap Genesis State (#960)
* wip: add swap state persistent to genesis

* separate pool record constructors; add tests for json and yaml encoding
of record structs

* beef up validation checks for state records

* fix integration with master - renamed method

* add test coverage for basic state array validations

* extra test around pool record reserve and id ordering to ensure no
regressions in the future

* add validations to ensure pool records and share records are unique
within the collection types

* test genesis json and yaml encoding

* validate in genesis that the total shares owned for each pool is equal
to the total shares of each pool

* update alias

* nit lint

* test genesis init and export

* add migration todo

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2021-07-15 09:42:30 -05:00
Ruaridh
013093ecb5
Incentive genesis refactor: remove sync on export (#954)
* move defualt values to file where they're used

* add type to hold RewardIndexes in genesis state

* add reward indexes state to genesis

* fix genesis state importers

* add iterator keeper methods for accrual times

* remove syncing from export/init genesis

* separate incentive migration to new file

* refactor out common funcs from incentive migration

* update legacy genesis state to v0.14.3

* add test and example migrated json

* fully initialize rewards in genesis builder

* add kava-7-mainnet incentive state

* run aliasgen

* add missing type to incentive/legacy

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-07-15 15:41:55 +01:00
Ruaridh
e48fed1e27
fix strings that said deposit instead of borrow (#962) 2021-07-15 09:16:25 -05:00
Ruaridh
38a98ac4fc
Refactor incentive payout (#953), Users can claim swap rewards (#955)
* split up payout.go file

* extract genesis builders to new testutil package

* move claim integration tests out of keeper

* convert claim integration tests to handler tests

* combine claim usdx minting keeper methods

* combine hard claim keeper methods

* combine delegator claim keeper methods

* add multiply coins helper method

* rename file to better match contents

* add basic claiming unit tests

* add claiming subset of delegator reward denoms

* refactor msg tests

* add msg ValidateBasic tests

* connect swap hooks into keeper methods

* tidy up delegator handler tests

* add swap claiming msgs and keeper method

* add swap claiming to client

* add subset claiming to other msg types

* split up handler test file

* connect up subset claiming for swap

* make multiplier name validation more strict

* fix: struct tag typo in swap incentives

* connect up subset claiming for hard

* connect up subset claiming for delegator

* fix: register cli tx routes for swp claiming

* fix claim amount in claim event

* fix token name in cli help docs

* remove unused field in msg tests

* tidy up swap and delegator handler tests

* refactor hard handler tests

* refactor usdx handler tests

* remove unused constant

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-07-15 15:05:54 +01:00