Skip to content

Commit

Permalink
[Tests]: Integrate defiplaza into the test environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOmarA committed Feb 27, 2024
1 parent fd64efe commit 87f5beb
Show file tree
Hide file tree
Showing 7 changed files with 318 additions and 11 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cSpell.words": [
"caviarnine",
"coffieicnet",
"defi",
"humantime",
"ociswap",
"OLYPS",
Expand Down
1 change: 1 addition & 0 deletions libraries/scrypto-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ quote = { version = "1.0.35" }
syn = { version = "2.0.48", features = ["full", "extra-traits"] }

[lib]
doctest = false
proc-macro = true

[lints]
Expand Down
68 changes: 61 additions & 7 deletions packages/defiplaza-v2-adapter-v1/src/blueprint_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use scrypto::prelude::*;
use scrypto_interface::*;

define_interface! {
PlazaDex as DefiPlazaV2Pool impl [
PlazaPair as DefiPlazaV2Pool impl [
ScryptoStub,
ScryptoTestStub,
#[cfg(feature = "manifest-builder-stubs")]
Expand Down Expand Up @@ -47,7 +47,16 @@ define_interface! {
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub struct PairConfig {
pub k_in: Decimal,
Expand All @@ -57,7 +66,16 @@ pub struct PairConfig {
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub struct TradeAllocation {
pub base_base: Decimal,
Expand All @@ -67,7 +85,16 @@ pub struct TradeAllocation {
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub struct PairState {
pub p0: Decimal,
Expand All @@ -78,7 +105,16 @@ pub struct PairState {
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub enum Shortage {
BaseShortage,
Expand All @@ -87,15 +123,33 @@ pub enum Shortage {
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub enum ShortageState {
Equilibrium,
Shortage(Asset),
}

#[derive(
ScryptoSbor, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash,
ScryptoSbor,
ManifestSbor,
Copy,
Clone,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
)]
pub enum Asset {
Base,
Expand Down
2 changes: 1 addition & 1 deletion packages/ociswap-v1-adapter-v1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ociswap-v1-adapter-v1"
version.workspace = true
edition.workspace = true
description = "Defines the adapter for Ociswap"
description = "Defines the adapter for Ociswap v1 - this is effectively deprecated since we won't be supporting Ociswap v1."

[dependencies]
sbor = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ ociswap-v2-adapter-v1 = { path = "../packages/ociswap-v2-adapter-v1", features =
"test",
"manifest-builder-stubs"
] }
defiplaza-v2-adapter-v1 = { path = "../packages/defiplaza-v2-adapter-v1", features = [
"test",
"manifest-builder-stubs"
] }
caviarnine-v1-adapter-v1 = { path = "../packages/caviarnine-v1-adapter-v1", features = [
"test",
"manifest-builder-stubs"
Expand Down
Loading

0 comments on commit 87f5beb

Please sign in to comment.