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

finalizing rent implementation #189

Merged
merged 7 commits into from
Oct 19, 2021
Merged

finalizing rent implementation #189

merged 7 commits into from
Oct 19, 2021

Conversation

KaiserKarel
Copy link
Contributor

@KaiserKarel KaiserKarel commented Oct 14, 2021

  • Implement tombstoning based on rent.
  • clean up tombstoned vaults

Copy link
Contributor

@dzmitry-lahoda dzmitry-lahoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id better than it was, may be clean up TODO comments on method call

Also ensure that tombstoned vaults have funds returned by strategies.
frame/vault/src/lib.rs Outdated Show resolved Hide resolved
@KaiserKarel KaiserKarel marked this pull request as ready for review October 19, 2021 08:52
frame/vault/src/lib.rs Outdated Show resolved Hide resolved
@KaiserKarel KaiserKarel merged commit 9366888 into develop Oct 19, 2021
@KaiserKarel KaiserKarel deleted the vault-rent branch October 19, 2021 14:13
dzmitry-lahoda pushed a commit that referenced this pull request Oct 20, 2021
* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment
dzmitry-lahoda pushed a commit that referenced this pull request Oct 21, 2021
* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

Signed-off-by: dzmitry-lahoda <[email protected]>
dzmitry-lahoda pushed a commit that referenced this pull request Oct 21, 2021
* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

Signed-off-by: dzmitry-lahoda <[email protected]>
dzmitry-lahoda added a commit that referenced this pull request Oct 21, 2021
* Refactoring of pallet-lending (#178)

* Create SECURITY.md (#111) (#174)

* Create SECURITY.md

Set up for security  protocols.

* More guidelines

* rewards section

Co-authored-by: Filip <[email protected]>

Update

setup-auto-release

Updating github workflow

Implement auto update feature using two approaches

Implement auto update feature using two approaches

Implement auto update feature using two approaches

Co-authored-by: Douglas Kuhn <[email protected]>

* Refactoring of pallet-lending (#182)

* - Implement dynamic PID controller based interest rate model.
      See details at https://www.delphidigital.io/reports/dynamic-interest-rate-model-based-on-control-theory/
    - Add InterestRate trait which provides get_borrow_rate() method.

* start refactor and inline docs (#169)

* start refactor and inline docs

* added more inline docs

* more docs

* clean

* quick clean

* fmt

* fmt

* polkadot-v0.9.11 (#187)

* fix wasm build (#192)

* fix wasm build

* pin orml to rev

* Update off-chain worker of pallet-lending (#190)

* remove request id (#194)

* test fixes (#195)

* Fix release benchmark feature build.

* Add cumulus-ping in Runtime (#197)

* enable CI on develop branch (#199)

* Implement DoubleExponent interest rate model. (#185)

* Copy and paste code of cumulus-ping pallet (#198)

* Remove unused dependencies (#203)

* pallet-assets (#112)

* POC of pallet-assets

* use Assets in vault::Config

* implement ReservableCurrency

make event a placeholder

* define and implement MultiCurrency trait

clippy

* use Assets as Currency implementation

* add extrinsics to pallet-asset

* weights file

weights working

weights added

* implement common orml traits

* implement MultiReservableCurrency

* Use WeightInfo in extrinsics

* fix merge

* Update benchmarks of pallet-lending (#148)

* Add offchain worker to monitor loans which should be liquidate or warned. (#151)

* Add offchain worker to monitor loans which should be liquidate or warned.

* Update benchmarks of pallet-lending

Co-authored-by: Andrey Orlov <[email protected]>

* light refactoring (#152)

* simplify traits

Prefer the usage of by-value for value parameters such as Balance
and the usage of `DispatchResult` instead of custom error.

* use try_mutate for mutating the auction order

* move `WrappingNext` to composable traits

* update gitignore, some tools are not supporting **/ patterns

* lending borrow/repay fixes & isolation test & more vault test (#156)

* add a note about how we are handling vault<->market

* use the more explicit type aliases

* `into_sub_account` require >8bytes AccountId

* fix borrow_for_collateral, express itself as borrow asset unit instead of $

* introduce vault stock_dilution_rate tests

* documentation & more inline pragmas

* better error name

When we hit a MustLiquidate while borrowing, this probably
mean that the market is being closed and waiting for repays
to happen.

* refactor

* avoid setting minimum deposit to let proptest pass with low values

* fix borrow/repay tests and introduce market isolation test

* auction and lending test fixes (#153)

Signed-off-by: dzmitry-lahoda <[email protected]>

* Pass InterestRateModel as input to create_new_market() extrinsic.

Co-authored-by: Filip <[email protected]>
Co-authored-by: andor0 <[email protected]>
Co-authored-by: Vivek Pandya <[email protected]>
Co-authored-by: Hussein Ait-Lahcen <[email protected]>
Co-authored-by: Dzmitry Lahoda <[email protected]>
Signed-off-by: dzmitry-lahoda <[email protected]>

* privileged accounts (liquidation) (#164)

* Refactoring of pallet-lending (#178)

* Create SECURITY.md (#111) (#174)

* Create SECURITY.md

Set up for security  protocols.

* More guidelines

* rewards section

Co-authored-by: Filip <[email protected]>

Update

setup-auto-release

Updating github workflow

Implement auto update feature using two approaches

Implement auto update feature using two approaches

Implement auto update feature using two approaches

Co-authored-by: Douglas Kuhn <[email protected]>

* better naming, comments & documentation

* introduce account privilege traits, allowing inspection + mutation

* introduce pallet-privilege which implements all the privilege traits

* add privilege pallet event triggers

* add privilege pallet readme

* refactor promote/revoke behavior to be noop over privileged/nonprivileged user

Co-authored-by: andor0 <[email protected]>
Co-authored-by: Adedayo Akinpelu <[email protected]>
Co-authored-by: Douglas Kuhn <[email protected]>
# Conflicts:
#	Cargo.lock
#	frame/lending/src/lib.rs
Signed-off-by: dzmitry-lahoda <[email protected]>

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>
# Conflicts:
#	Cargo.lock
#	frame/composable-traits/Cargo.toml
#	frame/composable-traits/src/lending.rs
#	frame/dutch-auction/src/lib.rs
#	frame/lending/src/lib.rs
#	frame/oracle/src/lib.rs

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints
# Conflicts:
#	frame/composable-traits/src/currency.rs
#	frame/composable-traits/src/lending.rs
#	frame/lending/src/lib.rs
#	frame/lending/src/tests.rs
#	frame/liquidations/src/lib.rs
#	frame/oracle/src/lib.rs
#	runtime/primitives/src/currency.rs

Signed-off-by: dzmitry-lahoda <[email protected]>

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment
# Conflicts:
#	frame/vault/src/lib.rs

Signed-off-by: dzmitry-lahoda <[email protected]>

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

Signed-off-by: dzmitry-lahoda <[email protected]>

* Use NativeCurrency associated type instead of querying for native id (#202)

# Conflicts:
#	Cargo.lock
#	frame/vault/Cargo.toml

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed lending tests and run cargo fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixes from fmt and clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixes to benches

Signed-off-by: dzmitry-lahoda <[email protected]>

Co-authored-by: andor0 <[email protected]>
Co-authored-by: Adedayo Akinpelu <[email protected]>
Co-authored-by: Douglas Kuhn <[email protected]>
Co-authored-by: Vivek Pandya <[email protected]>
Co-authored-by: JesseAbram <[email protected]>
Co-authored-by: Seun Lanlege <[email protected]>
Co-authored-by: Karel L. Kubat <[email protected]>
Co-authored-by: Filip <[email protected]>
Co-authored-by: Hussein Ait-Lahcen <[email protected]>
hussein-aitlahcen added a commit that referenced this pull request Dec 14, 2021
* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment
hussein-aitlahcen added a commit that referenced this pull request Dec 15, 2021
* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>
aettran pushed a commit that referenced this pull request Jan 3, 2022
* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>
benluelo pushed a commit that referenced this pull request Jan 3, 2022
* bump to 0.9.13

* cargo fmt

* bump subxt

* cargo fmt

* up simuator to 0.9.13

Signed-off-by: Dzmitry Lahoda <[email protected]>

* bump

Co-authored-by: Dzmitry Lahoda <[email protected]>

Bump picasso chain spec (#375)

* bump spec

* cargo fmt

Composable Runtime (#364)

* composable-runtime

* initial implementation

* support multiple runtimes for subcommand

* cargo fmt

CU-1nbhuu3 - upgrade price feed to match oracle (#373)

* upgrade price feed to match oracle, simplify normalization and allow more configuration

* use latest version of clap and add new required `derive` feature

* fix main

* apply clippy suggestions

adds composable chain spec (#378)

* adds composable chain spec

* cargo fmt

* fix clap

* sigh

Check runtime ci [WIP] (#379)

* Update Makefile

* Update release

* Update

* Updating release

* Added runtime check

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* remove westend-native

Co-authored-by: Seun Lanlege <[email protected]>

Add a sequence diagram to explain a work of pallet-assets-registry (#380)

Implement property test for add/remove_liquidity() and exchange().
Also fix minor bug found with proptesting.

CU-1nbj6eq - Cherry develop (#384)

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>

Update ansible picasso (#396)

Resolve conflicting `Cargo.lock` dependencies (#390)

Resolve conflicting `Cargo.lock` dependencies (#390)

Update ansible picasso (#399)

* Update ansible

Update GitHub ansible workflow (#407)

Update GitHub ansible workflow (#408)

CU-1wef6he - add enable/disable hook to call-filter and extract behavior to (#398)

composable-traits

We were previously using a map `Entry -> Option<()>` but a StorageMap `Entry -> ()`
is enough as it uses `OptionQuery` by default.

I added a way to hook into enable/disable call of the filter pallet to make it
more flexible. If we want to block a pallet from being disabled, it can now be
done at the Runtime declaration.

Architecture.md (#405)

* CU-1nbetfw - move `price-feed` in `utils`

* CU-1nbetfw - add `ARCHITECTURE.md` describind the repository architecture

Add `clippy::disallowed_method` lint

parent 62f6e5b
author Hussein Ait-Lahcen <[email protected]> 1640264806 +0100
committer Ben Luelo <[email protected]> 1641229158 -0500
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCgAdFiEEvcJAWzQ+hHD6e6hZKDJl/2mUhmAFAmHTK2YACgkQKDJl/2mU
 hmAZUgv/YlQbIMXV8utYIgxSDSTAGtW4Ruo5bXSQzDQJWKL8AMk04WJs/A2YgsV4
 v7COvbFaTEKM0BrfAbSd8RhGUI2xQmTtvzr3M7dXhTPh6UIRK1O2QU62XBwFlRiG
 m40HoP+FHnhdMeO49jiD+6JiJQZJ4YysLw3TpF4NMCLLAE+OEVUkTHkbovrawfte
 zPrw2suOz4PIhajPKlThPsyec7GfnLTRZFZcsjovSerI+BYUBIroCWtoLP3Hw873
 nCdve/HigNfwyeFVVw61coa8csqzN8CA2qzg2AFAHfsvNBil8baFJMywm+6vfV7s
 qnN+XK/GgrYZew5V00vNhKmW8h7/K0Gdyeuri/LelokXNE/PGiRrODl+066F/qCN
 U6urzh2nny1lTsbIoVMnOryk5yj3ekFd8Nsy/SmFtaGFjRvErdtZ0Qzd3zENVxie
 YCb4Msgce3UgZbQ8wLo3RaQKg+32i562ewDyWtnATG+CY+jCWeRlAqHYakTKzRrn
 91xqAEMi
 =4XKn
 -----END PGP SIGNATURE-----

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

CU-1wtx9fb Implement Constant Product AMM.

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix and/or audit indexing in oracle crate

Fix bug in add_liquidity

Add type annotation

Style & formatting

Fix extra underscore in integer literal

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

Squash

audit use of ValueQuery

audit usage of ValueQuery

audit ValueQuery in vault

audit usage of unwrap and ValueQuery in transaction-fee

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Audit use of ValueQuery in dutch-auction

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix bug in add_liquidity

Style & formatting

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

rustfmt
benluelo pushed a commit that referenced this pull request Jan 3, 2022
* bump to 0.9.13

* cargo fmt

* bump subxt

* cargo fmt

* up simuator to 0.9.13

Signed-off-by: Dzmitry Lahoda <[email protected]>

* bump

Co-authored-by: Dzmitry Lahoda <[email protected]>

Bump picasso chain spec (#375)

* bump spec

* cargo fmt

Composable Runtime (#364)

* composable-runtime

* initial implementation

* support multiple runtimes for subcommand

* cargo fmt

CU-1nbhuu3 - upgrade price feed to match oracle (#373)

* upgrade price feed to match oracle, simplify normalization and allow more configuration

* use latest version of clap and add new required `derive` feature

* fix main

* apply clippy suggestions

adds composable chain spec (#378)

* adds composable chain spec

* cargo fmt

* fix clap

* sigh

Check runtime ci [WIP] (#379)

* Update Makefile

* Update release

* Update

* Updating release

* Added runtime check

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* remove westend-native

Co-authored-by: Seun Lanlege <[email protected]>

Add a sequence diagram to explain a work of pallet-assets-registry (#380)

Implement property test for add/remove_liquidity() and exchange().
Also fix minor bug found with proptesting.

CU-1nbj6eq - Cherry develop (#384)

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>

Update ansible picasso (#396)

Resolve conflicting `Cargo.lock` dependencies (#390)

Resolve conflicting `Cargo.lock` dependencies (#390)

Update ansible picasso (#399)

* Update ansible

Update GitHub ansible workflow (#407)

Update GitHub ansible workflow (#408)

CU-1wef6he - add enable/disable hook to call-filter and extract behavior to (#398)

composable-traits

We were previously using a map `Entry -> Option<()>` but a StorageMap `Entry -> ()`
is enough as it uses `OptionQuery` by default.

I added a way to hook into enable/disable call of the filter pallet to make it
more flexible. If we want to block a pallet from being disabled, it can now be
done at the Runtime declaration.

Architecture.md (#405)

* CU-1nbetfw - move `price-feed` in `utils`

* CU-1nbetfw - add `ARCHITECTURE.md` describind the repository architecture

Add `clippy::disallowed_method` lint

parent 62f6e5b
author Hussein Ait-Lahcen <[email protected]> 1640264806 +0100
committer Ben Luelo <[email protected]> 1641229158 -0500
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCgAdFiEEvcJAWzQ+hHD6e6hZKDJl/2mUhmAFAmHTK2YACgkQKDJl/2mU
 hmAZUgv/YlQbIMXV8utYIgxSDSTAGtW4Ruo5bXSQzDQJWKL8AMk04WJs/A2YgsV4
 v7COvbFaTEKM0BrfAbSd8RhGUI2xQmTtvzr3M7dXhTPh6UIRK1O2QU62XBwFlRiG
 m40HoP+FHnhdMeO49jiD+6JiJQZJ4YysLw3TpF4NMCLLAE+OEVUkTHkbovrawfte
 zPrw2suOz4PIhajPKlThPsyec7GfnLTRZFZcsjovSerI+BYUBIroCWtoLP3Hw873
 nCdve/HigNfwyeFVVw61coa8csqzN8CA2qzg2AFAHfsvNBil8baFJMywm+6vfV7s
 qnN+XK/GgrYZew5V00vNhKmW8h7/K0Gdyeuri/LelokXNE/PGiRrODl+066F/qCN
 U6urzh2nny1lTsbIoVMnOryk5yj3ekFd8Nsy/SmFtaGFjRvErdtZ0Qzd3zENVxie
 YCb4Msgce3UgZbQ8wLo3RaQKg+32i562ewDyWtnATG+CY+jCWeRlAqHYakTKzRrn
 91xqAEMi
 =4XKn
 -----END PGP SIGNATURE-----

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

CU-1wtx9fb Implement Constant Product AMM.

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix and/or audit indexing in oracle crate

Fix bug in add_liquidity

Add type annotation

Style & formatting

Fix extra underscore in integer literal

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

Squash

audit use of ValueQuery

audit usage of ValueQuery

audit ValueQuery in vault

audit usage of unwrap and ValueQuery in transaction-fee

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Audit use of ValueQuery in dutch-auction

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix bug in add_liquidity

Style & formatting

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

rustfmt
KaiserKarel pushed a commit that referenced this pull request Jan 4, 2022
* Add `clippy::disallowed_method` lint

* Fix clippy lints

* cargo fmt

* Add clippy::indexing_slicing annotation to all crates

* Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

* Fix and/or audit indexing warninggs in oracle crate

* Fix and/or audit indexing in oracle crate

* Fix bug in add_liquidity

* Add type annotation

* Style & formatting

* Fix extra underscore in integer literal

* Add clippy::disallowed_type lint

* Change MockCurrencyId variants to be CONSTANT_CASE

* Remove uses of dbg!() macro

* rustfmt

* Upgrade parachain to polkadot-v0.9.13 (#372)

* bump to 0.9.13

* cargo fmt

* bump subxt

* cargo fmt

* up simuator to 0.9.13

Signed-off-by: Dzmitry Lahoda <[email protected]>

* bump

Co-authored-by: Dzmitry Lahoda <[email protected]>

Bump picasso chain spec (#375)

* bump spec

* cargo fmt

Composable Runtime (#364)

* composable-runtime

* initial implementation

* support multiple runtimes for subcommand

* cargo fmt

CU-1nbhuu3 - upgrade price feed to match oracle (#373)

* upgrade price feed to match oracle, simplify normalization and allow more configuration

* use latest version of clap and add new required `derive` feature

* fix main

* apply clippy suggestions

adds composable chain spec (#378)

* adds composable chain spec

* cargo fmt

* fix clap

* sigh

Check runtime ci [WIP] (#379)

* Update Makefile

* Update release

* Update

* Updating release

* Added runtime check

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* remove westend-native

Co-authored-by: Seun Lanlege <[email protected]>

Add a sequence diagram to explain a work of pallet-assets-registry (#380)

Implement property test for add/remove_liquidity() and exchange().
Also fix minor bug found with proptesting.

CU-1nbj6eq - Cherry develop (#384)

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>

Update ansible picasso (#396)

Resolve conflicting `Cargo.lock` dependencies (#390)

Resolve conflicting `Cargo.lock` dependencies (#390)

Update ansible picasso (#399)

* Update ansible

Update GitHub ansible workflow (#407)

Update GitHub ansible workflow (#408)

CU-1wef6he - add enable/disable hook to call-filter and extract behavior to (#398)

composable-traits

We were previously using a map `Entry -> Option<()>` but a StorageMap `Entry -> ()`
is enough as it uses `OptionQuery` by default.

I added a way to hook into enable/disable call of the filter pallet to make it
more flexible. If we want to block a pallet from being disabled, it can now be
done at the Runtime declaration.

Architecture.md (#405)

* CU-1nbetfw - move `price-feed` in `utils`

* CU-1nbetfw - add `ARCHITECTURE.md` describind the repository architecture

Add `clippy::disallowed_method` lint

parent 62f6e5b
author Hussein Ait-Lahcen <[email protected]> 1640264806 +0100
committer Ben Luelo <[email protected]> 1641229158 -0500
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCgAdFiEEvcJAWzQ+hHD6e6hZKDJl/2mUhmAFAmHTK2YACgkQKDJl/2mU
 hmAZUgv/YlQbIMXV8utYIgxSDSTAGtW4Ruo5bXSQzDQJWKL8AMk04WJs/A2YgsV4
 v7COvbFaTEKM0BrfAbSd8RhGUI2xQmTtvzr3M7dXhTPh6UIRK1O2QU62XBwFlRiG
 m40HoP+FHnhdMeO49jiD+6JiJQZJ4YysLw3TpF4NMCLLAE+OEVUkTHkbovrawfte
 zPrw2suOz4PIhajPKlThPsyec7GfnLTRZFZcsjovSerI+BYUBIroCWtoLP3Hw873
 nCdve/HigNfwyeFVVw61coa8csqzN8CA2qzg2AFAHfsvNBil8baFJMywm+6vfV7s
 qnN+XK/GgrYZew5V00vNhKmW8h7/K0Gdyeuri/LelokXNE/PGiRrODl+066F/qCN
 U6urzh2nny1lTsbIoVMnOryk5yj3ekFd8Nsy/SmFtaGFjRvErdtZ0Qzd3zENVxie
 YCb4Msgce3UgZbQ8wLo3RaQKg+32i562ewDyWtnATG+CY+jCWeRlAqHYakTKzRrn
 91xqAEMi
 =4XKn
 -----END PGP SIGNATURE-----

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

CU-1wtx9fb Implement Constant Product AMM.

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix and/or audit indexing in oracle crate

Fix bug in add_liquidity

Add type annotation

Style & formatting

Fix extra underscore in integer literal

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

Squash

audit use of ValueQuery

audit usage of ValueQuery

audit ValueQuery in vault

audit usage of unwrap and ValueQuery in transaction-fee

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Audit use of ValueQuery in dutch-auction

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix bug in add_liquidity

Style & formatting

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

rustfmt

* Fix error in pallet-vault

* Fix clippy warnings in dutch-auction

Co-authored-by: Seun Lanlege <[email protected]>
aettran pushed a commit that referenced this pull request Jan 4, 2022
* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>
aettran pushed a commit that referenced this pull request Jan 4, 2022
* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>
aettran pushed a commit that referenced this pull request Jan 4, 2022
* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>
dzmitry-lahoda pushed a commit that referenced this pull request Jan 5, 2022
* Add `clippy::disallowed_method` lint

* Fix clippy lints

* cargo fmt

* Add clippy::indexing_slicing annotation to all crates

* Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

* Fix and/or audit indexing warninggs in oracle crate

* Fix and/or audit indexing in oracle crate

* Fix bug in add_liquidity

* Add type annotation

* Style & formatting

* Fix extra underscore in integer literal

* Add clippy::disallowed_type lint

* Change MockCurrencyId variants to be CONSTANT_CASE

* Remove uses of dbg!() macro

* rustfmt

* Upgrade parachain to polkadot-v0.9.13 (#372)

* bump to 0.9.13

* cargo fmt

* bump subxt

* cargo fmt

* up simuator to 0.9.13

Signed-off-by: Dzmitry Lahoda <[email protected]>

* bump

Co-authored-by: Dzmitry Lahoda <[email protected]>

Bump picasso chain spec (#375)

* bump spec

* cargo fmt

Composable Runtime (#364)

* composable-runtime

* initial implementation

* support multiple runtimes for subcommand

* cargo fmt

CU-1nbhuu3 - upgrade price feed to match oracle (#373)

* upgrade price feed to match oracle, simplify normalization and allow more configuration

* use latest version of clap and add new required `derive` feature

* fix main

* apply clippy suggestions

adds composable chain spec (#378)

* adds composable chain spec

* cargo fmt

* fix clap

* sigh

Check runtime ci [WIP] (#379)

* Update Makefile

* Update release

* Update

* Updating release

* Added runtime check

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* remove westend-native

Co-authored-by: Seun Lanlege <[email protected]>

Add a sequence diagram to explain a work of pallet-assets-registry (#380)

Implement property test for add/remove_liquidity() and exchange().
Also fix minor bug found with proptesting.

CU-1nbj6eq - Cherry develop (#384)

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>

Update ansible picasso (#396)

Resolve conflicting `Cargo.lock` dependencies (#390)

Resolve conflicting `Cargo.lock` dependencies (#390)

Update ansible picasso (#399)

* Update ansible

Update GitHub ansible workflow (#407)

Update GitHub ansible workflow (#408)

CU-1wef6he - add enable/disable hook to call-filter and extract behavior to (#398)

composable-traits

We were previously using a map `Entry -> Option<()>` but a StorageMap `Entry -> ()`
is enough as it uses `OptionQuery` by default.

I added a way to hook into enable/disable call of the filter pallet to make it
more flexible. If we want to block a pallet from being disabled, it can now be
done at the Runtime declaration.

Architecture.md (#405)

* CU-1nbetfw - move `price-feed` in `utils`

* CU-1nbetfw - add `ARCHITECTURE.md` describind the repository architecture

Add `clippy::disallowed_method` lint

parent 62f6e5b
author Hussein Ait-Lahcen <[email protected]> 1640264806 +0100
committer Ben Luelo <[email protected]> 1641229158 -0500
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCgAdFiEEvcJAWzQ+hHD6e6hZKDJl/2mUhmAFAmHTK2YACgkQKDJl/2mU
 hmAZUgv/YlQbIMXV8utYIgxSDSTAGtW4Ruo5bXSQzDQJWKL8AMk04WJs/A2YgsV4
 v7COvbFaTEKM0BrfAbSd8RhGUI2xQmTtvzr3M7dXhTPh6UIRK1O2QU62XBwFlRiG
 m40HoP+FHnhdMeO49jiD+6JiJQZJ4YysLw3TpF4NMCLLAE+OEVUkTHkbovrawfte
 zPrw2suOz4PIhajPKlThPsyec7GfnLTRZFZcsjovSerI+BYUBIroCWtoLP3Hw873
 nCdve/HigNfwyeFVVw61coa8csqzN8CA2qzg2AFAHfsvNBil8baFJMywm+6vfV7s
 qnN+XK/GgrYZew5V00vNhKmW8h7/K0Gdyeuri/LelokXNE/PGiRrODl+066F/qCN
 U6urzh2nny1lTsbIoVMnOryk5yj3ekFd8Nsy/SmFtaGFjRvErdtZ0Qzd3zENVxie
 YCb4Msgce3UgZbQ8wLo3RaQKg+32i562ewDyWtnATG+CY+jCWeRlAqHYakTKzRrn
 91xqAEMi
 =4XKn
 -----END PGP SIGNATURE-----

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

CU-1wtx9fb Implement Constant Product AMM.

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix and/or audit indexing in oracle crate

Fix bug in add_liquidity

Add type annotation

Style & formatting

Fix extra underscore in integer literal

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

Squash

audit use of ValueQuery

audit usage of ValueQuery

audit ValueQuery in vault

audit usage of unwrap and ValueQuery in transaction-fee

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Audit use of ValueQuery in dutch-auction

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix bug in add_liquidity

Style & formatting

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

rustfmt

* Fix error in pallet-vault

* Fix clippy warnings in dutch-auction

Co-authored-by: Seun Lanlege <[email protected]>
Signed-off-by: Dzmitry Lahoda <[email protected]>
dzmitry-lahoda pushed a commit that referenced this pull request Jan 5, 2022
* Add `clippy::disallowed_method` lint

* Fix clippy lints

* cargo fmt

* Add clippy::indexing_slicing annotation to all crates

* Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

* Fix and/or audit indexing warninggs in oracle crate

* Fix and/or audit indexing in oracle crate

* Fix bug in add_liquidity

* Add type annotation

* Style & formatting

* Fix extra underscore in integer literal

* Add clippy::disallowed_type lint

* Change MockCurrencyId variants to be CONSTANT_CASE

* Remove uses of dbg!() macro

* rustfmt

* Upgrade parachain to polkadot-v0.9.13 (#372)

* bump to 0.9.13

* cargo fmt

* bump subxt

* cargo fmt

* up simuator to 0.9.13

Signed-off-by: Dzmitry Lahoda <[email protected]>

* bump

Co-authored-by: Dzmitry Lahoda <[email protected]>

Bump picasso chain spec (#375)

* bump spec

* cargo fmt

Composable Runtime (#364)

* composable-runtime

* initial implementation

* support multiple runtimes for subcommand

* cargo fmt

CU-1nbhuu3 - upgrade price feed to match oracle (#373)

* upgrade price feed to match oracle, simplify normalization and allow more configuration

* use latest version of clap and add new required `derive` feature

* fix main

* apply clippy suggestions

adds composable chain spec (#378)

* adds composable chain spec

* cargo fmt

* fix clap

* sigh

Check runtime ci [WIP] (#379)

* Update Makefile

* Update release

* Update

* Updating release

* Added runtime check

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* Testing runtime checki ci for chachacha branch

* remove westend-native

Co-authored-by: Seun Lanlege <[email protected]>

Add a sequence diagram to explain a work of pallet-assets-registry (#380)

Implement property test for add/remove_liquidity() and exchange().
Also fix minor bug found with proptesting.

CU-1nbj6eq - Cherry develop (#384)

* dex docs, groups for lending, api (#183)

Signed-off-by: dzmitry-lahoda <[email protected]>

* smallest possible unit for currencies + refactor + lending fixes / tests more clear (#186)

* make sure we allow liquidation if the source account has zero funds after

* introduce PriceableAsset capability

* refactor lending pallet + oracle mock to use smallest unit of an asset

* fix merge conflicts, make tests more clear

* simpler priceable type & upgrade runtime currency to handle it

* simplify and better documentation

* cleanup unused constraints

* Vault-index-configurable (#200)

* make VaultId an associated type

* Unmanle doc comment

* rent implementation (#189)

* implement rent and tombstoning

* clean up claim_surcharge

Also ensure that tombstoned vaults have funds returned by strategies.

* handle deletion_reward

* add delete_tombstoned functionality

* add add_surcharge

* fmt and fix doc comment

* Use NativeCurrency associated type instead of querying for native id (#202)

* Update Vault Readme (#207)

* describe vault

* sync readme with rustdoc

* Tests documentations & refactoring (#254)

* introduce composable-helpers

* refactor vault/lending tests to use composable-helpers

* apply advices

* Vault benchmarking (#270)

* fix missing runtime paramter

* add vault benchmarking

* Update CI config

Co-authored-by: Andrey Orlov <[email protected]>

* CU-1kjehh6 - avoid less than expected bonus by using safe maths (#289)

* CU-1kr011f - merge allocations in StrategyOverview (#290)

Both Allocations and CapitaalStructure storage map were tied.
Which mean you couldn't have an allocation without having a StrategyOverview.
This was wrong for the case of the reserve, as the vault itself has an
allocation (the reserve) but no StrategyOverview.

Because of that, one could trigger a panic by asking for `available_funds` using
the vault id.
We fix this issue by merging the allocation inside the StrategyOverview.

* fix benchmarking

* feature gate vault benchmark

* apply udeps suggestions

* update cargo.lock

Co-authored-by: Andrey Orlov <[email protected]>

Update ansible picasso (#396)

Resolve conflicting `Cargo.lock` dependencies (#390)

Resolve conflicting `Cargo.lock` dependencies (#390)

Update ansible picasso (#399)

* Update ansible

Update GitHub ansible workflow (#407)

Update GitHub ansible workflow (#408)

CU-1wef6he - add enable/disable hook to call-filter and extract behavior to (#398)

composable-traits

We were previously using a map `Entry -> Option<()>` but a StorageMap `Entry -> ()`
is enough as it uses `OptionQuery` by default.

I added a way to hook into enable/disable call of the filter pallet to make it
more flexible. If we want to block a pallet from being disabled, it can now be
done at the Runtime declaration.

Architecture.md (#405)

* CU-1nbetfw - move `price-feed` in `utils`

* CU-1nbetfw - add `ARCHITECTURE.md` describind the repository architecture

Add `clippy::disallowed_method` lint

parent 62f6e5b
author Hussein Ait-Lahcen <[email protected]> 1640264806 +0100
committer Ben Luelo <[email protected]> 1641229158 -0500
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCgAdFiEEvcJAWzQ+hHD6e6hZKDJl/2mUhmAFAmHTK2YACgkQKDJl/2mU
 hmAZUgv/YlQbIMXV8utYIgxSDSTAGtW4Ruo5bXSQzDQJWKL8AMk04WJs/A2YgsV4
 v7COvbFaTEKM0BrfAbSd8RhGUI2xQmTtvzr3M7dXhTPh6UIRK1O2QU62XBwFlRiG
 m40HoP+FHnhdMeO49jiD+6JiJQZJ4YysLw3TpF4NMCLLAE+OEVUkTHkbovrawfte
 zPrw2suOz4PIhajPKlThPsyec7GfnLTRZFZcsjovSerI+BYUBIroCWtoLP3Hw873
 nCdve/HigNfwyeFVVw61coa8csqzN8CA2qzg2AFAHfsvNBil8baFJMywm+6vfV7s
 qnN+XK/GgrYZew5V00vNhKmW8h7/K0Gdyeuri/LelokXNE/PGiRrODl+066F/qCN
 U6urzh2nny1lTsbIoVMnOryk5yj3ekFd8Nsy/SmFtaGFjRvErdtZ0Qzd3zENVxie
 YCb4Msgce3UgZbQ8wLo3RaQKg+32i562ewDyWtnATG+CY+jCWeRlAqHYakTKzRrn
 91xqAEMi
 =4XKn
 -----END PGP SIGNATURE-----

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

CU-1wtx9fb Implement Constant Product AMM.

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix and/or audit indexing in oracle crate

Fix bug in add_liquidity

Add type annotation

Style & formatting

Fix extra underscore in integer literal

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

Squash

audit use of ValueQuery

audit usage of ValueQuery

audit ValueQuery in vault

audit usage of unwrap and ValueQuery in transaction-fee

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Audit use of ValueQuery in dutch-auction

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

Audit clippy warnings in curve-amm pallet

indexing and slicing warning have been suppressed for now; A larger refactor will be required to remove the indexing that remains.

Fix compilation error in test_interest_rate_model_default

Audit/ fix clippy warnings in assets-registry and dutch-auction

Fix or temporarilly suppress various clippy warnings

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

rustfmt

Signed-off-by: Ben Luelo <[email protected]>

CU-1kr4tya - Crowdloan rewards benchmarking (#412)

* CU-1kr4tya - crowdloan rewards benchmarking

* fix main benchmarking

* add crowdloan-rewards to runtime and generated benchmark weights

* update cargo lock

* refactor crowdloan rewards test to use 1:1 benchmarking types

* fix populate weight calculation

* make sure to remove rewards prior to populate

* use runtime prefix in benchmarking

* unused dependency

Run benchmark for develop and fix `cargo vendor` (#419)

Democracy (#389)

* CU-1rpbzkw - democracy pallet

Fixed missing test cases and related dependencies

Added missing test cases

Fixed format errors and docs

Fixing docs

 CU-1rpbzkw | Fixed failing test case

CU-1rpbzkw | handle transfer_held() result

CU-1rpbzkw | added few more multi currency tests

CU-1rpbzkw | fixing fmt

Changes & fixes for benchmarking

Linting fixes

* Democracy

Co-authored-by: kaiserkarel <[email protected]>

split out dali runtime from picasso (#421)

* split out dali runtime from picasso

* cargo fm

* fix runtimes

* cargo fmt

[BondedFinance] Add benchmarks (#377)

Add email (#431)

Add rust-toolchain.toml (#435)

* Add rust-toolchain.toml
* Remove ConvertInto import

Fix clippy lints

cargo fmt

Add clippy::indexing_slicing annotation to all crates

Fix slicing warnings in curve-amm crate.

I wasn't able to fix all of the occurences or slicing; some functions take indexes directly. I feel like these should be using .get(n) and returning some sort of dispatch error instead of panicking, but I'm not knowledgeable enough about substrate to say for sure. All instances of this have been annoted with a `REVIEW: indexing` comment at the function level.

Fix and/or audit indexing warninggs in oracle crate

Fix bug in add_liquidity

Style & formatting

Add clippy::disallowed_type lint

Change MockCurrencyId variants to be CONSTANT_CASE

Remove uses of dbg!() macro

rustfmt

CU-1p8545r  dutch auction (#410)

* dutch auction

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed tests

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed review comments

Signed-off-by: dzmitry-lahoda <[email protected]>

* adding tests and fixing bugs

Signed-off-by: dzmitry-lahoda <[email protected]>

* refactoring

Signed-off-by: dzmitry-lahoda <[email protected]>

* fix fmt

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed udeps

Signed-off-by: dzmitry-lahoda <[email protected]>

* fixed clippy

Signed-off-by: dzmitry-lahoda <[email protected]>

rustfmt

* Fix error in pallet-vault

* Fix clippy warnings in dutch-auction

Co-authored-by: Seun Lanlege <[email protected]>
Signed-off-by: Dzmitry Lahoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants