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
1 change: 1 addition & 0 deletions mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enable-sia = [
"dep:blake2b_simd",
"dep:sia-rust"
]
enable-solana = []
default = []
run-docker-tests = []
for-tests = ["dep:mocktopus"]
Expand Down
14 changes: 14 additions & 0 deletions mm2src/coins/lp_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ use crate::coin_balance::{BalanceObjectOps, HDWalletBalanceObject};
use crate::hd_wallet::{AddrToString, DisplayAddress};
use z_coin::{ZCoin, ZcoinProtocolInfo};

#[cfg(feature = "enable-solana")]
pub mod solana;

pub type TransactionFut = Box<dyn Future<Item = TransactionEnum, Error = TransactionErr> + Send>;
pub type TransactionResult = Result<TransactionEnum, TransactionErr>;
pub type BalanceResult<T> = Result<T, MmError<BalanceError>>;
Expand Down Expand Up @@ -3723,6 +3726,8 @@ pub enum MmCoinEnum {
LightningCoin(LightningCoin),
#[cfg(feature = "enable-sia")]
SiaCoin(SiaCoin),
#[cfg(feature = "enable-solana")]
Solana(solana::SolanaCoin),
Comment on lines +3729 to +3730
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Something I remembered that shortens the time for you in the future is to add Solana here https://github.com/KomodoPlatform/komodo-defi-framework/blob/6085ac4fa847245e4730b97d4cac7937401df567/mm2src/coins/lp_coins.rs#L3865-L3878
Or just move this function to a trait and remove this default implementation. This is of course for next PRs. Hope there is no other things like this that I forgot about, but checking default trait implementations can help you, if not, you will find out while testing for sure.

#[cfg(any(test, feature = "for-tests"))]
Test(TestCoin),
}
Expand Down Expand Up @@ -3789,6 +3794,13 @@ impl From<LightningCoin> for MmCoinEnum {
}
}

#[cfg(feature = "enable-solana")]
impl From<solana::SolanaCoin> for MmCoinEnum {
fn from(c: solana::SolanaCoin) -> MmCoinEnum {
MmCoinEnum::Solana(c)
}
}

impl From<ZCoin> for MmCoinEnum {
fn from(c: ZCoin) -> MmCoinEnum {
MmCoinEnum::ZCoin(c)
Expand Down Expand Up @@ -3820,6 +3832,8 @@ impl Deref for MmCoinEnum {
MmCoinEnum::ZCoin(ref c) => c,
#[cfg(feature = "enable-sia")]
MmCoinEnum::SiaCoin(ref c) => c,
#[cfg(feature = "enable-solana")]
MmCoinEnum::Solana(ref c) => c,
#[cfg(any(test, feature = "for-tests"))]
MmCoinEnum::Test(ref c) => c,
}
Expand Down
5 changes: 5 additions & 0 deletions mm2src/coins/solana/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod solana_coin;

pub use solana_coin::SolanaCoin;
pub use solana_coin::SolanaInitError;
pub use solana_coin::SolanaProtocolInfo;
Loading
Loading