Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 13 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,3 @@ https://www.shawntabrizi.com/substrate-graph-benchmarks/docs/#/
https://substrate.dev/docs/en/knowledgebase/runtime/benchmarking
https://crates.io/crates/frame-benchmarking
https://github.com/paritytech/substrate/tree/polkadot-v0.9.8/frame/benchmarking

3 changes: 1 addition & 2 deletions frame/assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors = ["Composable Developers"]
homepage = "https://composable.finance"
edition = "2021"


[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down Expand Up @@ -36,7 +35,7 @@ num-traits = { version = "0.2.14", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false }
governance-registry = { package = "pallet-governance-registry", path = "../governance-registry", default-features = false }
proptest = "0.9.6"
proptest = "1.0"
composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false }

[package.metadata.cargo-udeps.ignore]
Expand Down
4 changes: 3 additions & 1 deletion frame/composable-traits/src/defi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use sp_runtime::{
ArithmeticError, DispatchError, FixedPointNumber, FixedPointOperand, FixedU128,
};

use sp_std::fmt::Debug;

use crate::currency::{AssetIdLike, BalanceLike, MathBalance};

#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -205,7 +207,7 @@ pub trait SellEngine<Configuration>: DeFiEngine {
}

pub trait DeFiComposableConfig: frame_system::Config {
type MayBeAssetId: AssetIdLike + MaybeSerializeDeserialize + Default;
type MayBeAssetId: AssetIdLike + MaybeSerializeDeserialize + Default + MaxEncodedLen + Debug;

type Balance: BalanceLike
+ MathBalance
Expand Down
4 changes: 2 additions & 2 deletions frame/composable-traits/src/lending/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub struct CreateInput<LiquidationStrategyId, AssetId> {
pub reserved_factor: Perquintill,
}

#[derive(Clone, Copy, Debug, PartialEq, TypeInfo)]
#[derive(Clone, Copy, Debug, PartialEq, TypeInfo, Default)]
pub struct MarketModelValid;
#[derive(Clone, Copy, Debug, PartialEq, TypeInfo)]
#[derive(Clone, Copy, Debug, PartialEq, TypeInfo, Default)]
pub struct CurrencyPairIsNotSame;

impl<LiquidationStrategyId, Asset: Eq>
Expand Down
5 changes: 4 additions & 1 deletion frame/composable-traits/src/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ use crate::{
use frame_support::{dispatch::DispatchError, pallet_prelude::*};
use sp_std::vec::Vec;

#[derive(Encode, Decode, Default, Debug, PartialEq)]
// block timestamped value
#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, PartialEq, TypeInfo, Clone)]
pub struct Price<PriceValue, BlockNumber> {
/// value
pub price: PriceValue,
pub block: BlockNumber,
}
Expand Down Expand Up @@ -89,6 +91,7 @@ pub trait Oracle {
/// Given `asset_id` and `amount` of price asset.
/// Returns what amount of `asset_id` will be required to be same price as `amount` of
/// normalized currency
/// `amount` - in smallest units
fn get_price_inverse(
asset_id: Self::AssetId,
amount: Self::Balance,
Expand Down
2 changes: 1 addition & 1 deletion frame/crowdloan-rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ libsecp256k1 = { version = "0.7.0", default-features = false, features = [
"hmac",
"static-context",
] }
hex-literal = "0.3"
hex-literal = "0.3.3"
balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, features = [ "std" ]}

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion frame/currency-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ composable-traits = { path = "../composable-traits", default-features = false }

[dev-dependencies]
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
proptest = "0.9.6"
proptest = "1.0.0"
composable-tests-helpers = { version = "0.0.1", path = "../composable-tests-helpers", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion frame/curve-amm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "p
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false }
pallet-currency-factory = { version = "0.0.1", path = "../currency-factory" }
proptest = "0.9.6"
proptest = "1.0"

[features]
default = ["std"]
Expand Down
24 changes: 0 additions & 24 deletions frame/dutch-auction/src/mock/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,56 +54,32 @@ frame_support::construct_runtime! {
parameter_types! {
pub const SS58Prefix: u8 = 42;
pub const BlockHashCount: u64 = 250;

}

impl frame_system::Config for Runtime {
type BaseCallFilter = Everything;

type BlockWeights = ();

type BlockLength = ();

type Origin = Origin;

type Call = Call;

type Index = u64;

type BlockNumber = u64;

type Hash = H256;

type Hashing = BlakeTwo256;

type AccountId = AccountId;

type Lookup = IdentityLookup<Self::AccountId>;

type Header = Header;

type Event = Event;

type BlockHashCount = BlockHashCount;

type DbWeight = ();

type Version = ();

type PalletInfo = PalletInfo;

type AccountData = pallet_balances::AccountData<Balance>;

type OnNewAccount = ();

type OnKilledAccount = ();

type SystemWeightInfo = ();

type SS58Prefix = SS58Prefix;

type OnSetCode = ();

type MaxConsumers = frame_support::traits::ConstU32<16>;
}

Expand Down
19 changes: 12 additions & 7 deletions frame/lending/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ version = "2.0.0"
frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true }

sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
Expand All @@ -31,30 +33,30 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/subst

composable-traits = { default-features = false, path = "../composable-traits" }
composable-support = { default-features = false, path = "../composable-support" }
pallet-oracle = { default-features = false, optional = true, version = "1.0.0", path = "../oracle" }
pallet-oracle = { default-features = false, optional = true, path = "../oracle" }
pallet-vault = { default-features = false, path = "../vault", optional = true }

log = { version = "0.4.14", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
plotters = { version = "0.3.1", optional = true }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = '1.0.130' }

[dev-dependencies]
hex-literal = "0.3.3"
once_cell = "1.8.0"
proptest = "0.9.6"
proptest = "1.0"
smallvec = "1.7.0"
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = true }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" }
pallet-currency-factory = { path = "../currency-factory" }
pallet-liquidations = { path = "../liquidations" }
pallet-dutch-auction = { path = "../dutch-auction", default-features = false }
composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false }
pallet-assets = { path = '../assets', default-features = false }

serde = { version = '1.0.130' }
pallet-assets = { path = '../assets', default-features = false}
frame-benchmarking = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }

[features]
default = ["std"]
Expand All @@ -70,15 +72,18 @@ std = [
"sp-arithmetic/std",
"composable-traits/std",
"pallet-vault/std",
"orml-tokens/std",
"scale-info/std",
"pallet-oracle/std",
]

runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-oracle/runtime-benchmarks",
"pallet-vault/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
]

visualization = ["plotters"]
1 change: 1 addition & 0 deletions frame/lending/proptest-regressions/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ cc 105541697ded40d7111e1cd357efd01fe710dfdeda9d88044a73316520487f24 # shrinks to
cc 738fc7fe1be060a08d13e3e2fa521af22fd53a5b0f5a50d8042fe88c4ca2a5a4 # shrinks to depth = 0
cc 52628c1411e4d9f8f7abaf6ad392c47e27083cf0a67294329a08f2f28a05e624 # shrinks to amount = 1000
cc ef61546023a270a01b0b7586ed06ea032b11e5b016464600d167dfc39cd3298c # shrinks to amount = 1000
cc a86d61e12bf3f1b42d240a6c693f8845bede3f36f44274996b9af889df6d2fcc # shrinks to (amount1, amount2) = (1000, 1000)
Loading