mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 21:49:26 +00:00
make remove liquidity an authorized call
This commit is contained in:
@@ -204,14 +204,9 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
}
|
||||
InInstruction::GenesisLiquidity(ops) => match ops {
|
||||
GenesisLiquidityOperation::Add(address, balance) => {
|
||||
GenesisLiq::<T>::add_coin_liquidity(address.into(), balance)?;
|
||||
}
|
||||
GenesisLiquidityOperation::Remove(address, balance, out_address) => {
|
||||
GenesisLiq::<T>::remove_coin_liquidity(address.into(), balance, out_address)?;
|
||||
}
|
||||
},
|
||||
InInstruction::GenesisLiquidity(address) => {
|
||||
GenesisLiq::<T>::add_coin_liquidity(address.into(), instruction.balance)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -71,15 +71,6 @@ pub enum DexCall {
|
||||
Swap(Balance, OutAddress),
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Zeroize))]
|
||||
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub enum GenesisLiquidityOperation {
|
||||
Add(SeraiAddress, Balance),
|
||||
Remove(SeraiAddress, Balance, ExternalAddress),
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Zeroize))]
|
||||
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
|
||||
@@ -87,7 +78,7 @@ pub enum GenesisLiquidityOperation {
|
||||
pub enum InInstruction {
|
||||
Transfer(SeraiAddress),
|
||||
Dex(DexCall),
|
||||
GenesisLiquidity(GenesisLiquidityOperation),
|
||||
GenesisLiquidity(SeraiAddress),
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)]
|
||||
|
||||
Reference in New Issue
Block a user